Learn R Programming

graphlayouts (version 0.2.0)

layout_igraph_stress: Stress majorization graph layout

Description

Stress majorization graph layout

Usage

layout_igraph_stress(g, iter = 500, tol = 1e-04, mds = TRUE,
  bbox = 50, circular)

layout_with_stress(g, iter = 500, tol = 1e-04, mds = TRUE, bbox = 50)

Arguments

g

igraph object

iter

number of iterations

tol

stopping criterion

mds

should an MDS layout be used as initial layout (default: TRUE)

bbox

constrain dimension of output

circular

not used

Value

coordinates to be used layouting a graph

Details

the layout_igraph_* function should not be used directly. It is only used as an argument for 'ggraph'.

References

Gansner, E. R., Koren, Y., & North, S. (2004). Graph drawing by stress majorization. In International Symposium on Graph Drawing (pp. 239-250). Springer, Berlin, Heidelberg.

Examples

Run this code
# NOT RUN {
library(igraph)
library(ggraph)
set.seed(665)

g <- sample_pa(100,1,1,directed = FALSE)

#calculate layout manualy
xy <- layout_with_stress(g)
#use it with ggraph
ggraph(g,layout="stress")+
  geom_edge_link(width=0.2,colour="grey")+
  geom_node_point(col="black",size=0.3)+
  theme_graph()
# }

Run the code above in your browser using DataLab