layout

0th

Percentile

Generate coordinates for plotting graphs

Some simple and not so simple functions determining the placement of the vertices for drawing a graph.

Keywords
graphs
Usage
layout.random(graph, params)
layout.circle(graph, params)
layout.fruchterman.reingold(graph, ..., params)
layout.kamada.kawai(graph, ..., params)
layout.spring(graph, ..., params)
Arguments
graph
The graph to place.
params
The list of function dependent parameters.
...
Function dependent parameters, this is an alternative notation to the params argument.
Details

These functions calculate the coordinates of the vertices for a graph usually based on some optimality criterion.

layout.random simply places the vertices randomly on a square. It has no parameters.

layout.circle places the vertices on a unit circle equidistantly. It has no paramaters.

layout.fruchterman.reingold uses a force-based algorithm proposed by Fruchterman and Reingold, see references. Parameters and their default values:

  • niter
{Numeric, the number of iterations to perform (500).} coolexp{Numeric, the cooling exponent for the simulated annealing (3).} maxdelta{Maximum change (vcount(graph)).} area{Area parameter (vcount(graph)^2).} repulserad{Cancellation radius (area*vcount(graph)).}

Value

  • All these functions return a numeric matrix with at least two columns and the same number of lines as the number of vertices.

code

layout.spring

itemize

  • mass

item

  • sigma
  • initemp
  • coolexp
  • kkconst
  • equil
  • k
  • repeqdis
  • kfr
  • repulse

sQuote

  • quasi-kilograms
  • quasi-meters
  • quasi-Newtons per quasi-meter
  • quasi-meters
  • quasi-Newton quasi-kilograms

References

Fruchterman, T.M.J. and Reingold, E.M. (1991). Graph Drawing by Force-directed Placement. Software - Practice and Experience, 21(11):1129-1164.

Kamada, T. and Kawai, S. (1989). An Algorithm for Drawing General Undirected Graphs. Information Processing Letters, 31(1):7-15.

See Also

plot.igraph, tkplot

Aliases
  • layout
  • layout.random
  • layout.circle
  • layout.fruchterman.reingold
  • layout.kamada.kawai
  • layout.spring
Examples
g <- graph.ring(10)
layout.random(g)
layout.kamada.kawai(g)
Documentation reproduced from package igraph, version 0.1.2, License: GPL version 2 or later (June, 1991)

Community examples

Looks like there are no examples yet.