layout_spectral | R Documentation |
Using a set of eigenvectors of matrices associated with a graph as coordinates
layout_with_eigen(g, type = "laplacian", ev = "smallest")
layout_igraph_eigen(g, type = "laplacian", ev = "smallest", circular)
g |
igraph object |
type |
matrix to be used for spectral decomposition. either 'adjacency' or 'laplacian' |
ev |
eigenvectors to be used. Either 'smallest' or 'largest'. |
circular |
not used |
The layout_igraph_* function should not be used directly. It is only used as an argument for plotting with 'igraph'. 'ggraph' natively supports the layout.
matrix of xy coordinates
David Schoch
library(igraph)
g <- sample_gnp(50, 0.2)
xy <- layout_with_eigen(g, type = "adjacency", ev = "largest")
xy <- layout_with_eigen(g, type = "adjacency", ev = "smallest")
xy <- layout_with_eigen(g, type = "laplacian", ev = "largest")
xy <- layout_with_eigen(g, type = "laplacian", ev = "smallest")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.