library(igraph)
set.seed(665)
g <- sample_pa(100, 1, 1, directed = FALSE)
# calculate layout manually
xy <- layout_with_stress(g)
# use it with ggraph
if (FALSE) {
library(ggraph)
ggraph(g, layout = "stress") +
geom_edge_link0(edge_width = 0.2, colour = "grey") +
geom_node_point(col = "black", size = 0.3) +
theme_graph()
}
Run the code above in your browser using DataLab