Network spring embedding in R

From InterSciWiki
Jump to: navigation, search


As for spring embedding, the igraph "plot" function defaults to a Kamada-Kawai layout on "cohesive.blocks" output, but specifying another is simple:

plot(gBlocks, layout=layout.spring)

the command "?layout" lists all of the options for the layout ("layout.random", "layout.circle", etc) and any available parameters.

To specify parameters for the spring embedding (k, mass, etc.) use:

plot(gBlocks, layout=layout.spring(gBlocks, k=.015, mass=2))

(notice that it is necessary to specify the object you want to plot ("gBlocks") in two places in the command if you specify parameters)

Peter McMahan 1-10-2008

See Nework spring embedding in Matlab

Personal tools