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, dim=2)
layout.circle(graph, params)
layout.sphere(graph, params)
layout.fruchterman.reingold(graph, ..., dim=2,
      verbose=igraph.par("verbose"), params)
layout.kamada.kawai(graph, ..., dim=2,
      verbose=igraph.par("verbose"), params)
layout.spring(graph, ..., params)
layout.reingold.tilford(graph, ..., params)
layout.fruchterman.reingold.grid(graph, ...,
      verbose=igraph.par("verbose"), params)
layout.lgl(graph, ..., params)
layout.graphopt(graph, ..., verbose = igraph.par("verbose"), params = list())
layout.mds(graph, d=shortest.paths(graph), ...)
layout.svd(graph, d=shortest.paths(graph), ...)
layout.norm(layout, xmin = NULL, xmax = NULL, ymin = NULL, ymax = NULL,
      zmin = NULL, zmax = NULL)
Arguments
graph
The graph to place.
params
The list of function dependent parameters.
dim
Numeric constant, either 2 or 3. Some functions are able to generate 2d and 3d layouts as well, supply this argument to change the default behavior.
...
Function dependent parameters, this is an alternative notation to the params argument.
verbose
Logial constant, whether to show a progress bar while calculating the layout.
d
The matrix used for multidimansional scaling. By default it is the distance matrix of the graph.
layout
A matrix with two or three columns, the layout to normalize.
xmin,xmax
The limits for the first coordinate, if one of them or both are NULL then no normalization is performed along this direction.
ymin,ymax
The limits for the second coordinate, if one of them or both are NULL then no normalization is performed along this direction.
zmin,zmax
The limits for the third coordinate, if one of them or both are NULL then no normalization is performed along this direction.
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.sphere places the vertices (approximately) uniformly on the surface of a sphere, this is thus a 3d layout. It is not clear however what uniformly on a sphere means. 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)).} weights{A vector giving edge weights or NULL. If not NULL then the attraction along the edges will be multiplied by the given edge weights (NULL).}

Value

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

concept

Graph layout

code

layout.drl

itemize

  • niter

item

  • sigma
  • initemp
  • coolexp
  • kkconst
  • equil
  • k
  • repeqdis
  • kfr
  • repulse
  • circular
  • maxdelta
  • area
  • coolexp
  • repulserad
  • cellsize
  • maxdelta
  • area
  • coolexp
  • repulserad
  • cellsize
  • root
  • charge
  • mass
  • spring.length
  • spring.constant
  • max.sa.movement
  • start

sQuote

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

url

  • http://bioinformatics.icmb.utexas.edu/lgl
  • http://www.schmuhl.org/graphopt/

emph

  • experimental
  • experimental

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.

Reingold, E and Tilford, J (1981). Tidier drawing of trees. IEEE Trans. on Softw. Eng., SE-7(2):223--228.

See Also

layout.drl, plot.igraph, tkplot

Aliases
  • layout
  • layout.random
  • layout.circle
  • layout.sphere
  • layout.fruchterman.reingold
  • layout.fruchterman.reingold.grid
  • layout.kamada.kawai
  • layout.spring
  • layout.reingold.tilford
  • layout.lgl
  • layout.mds
  • layout.svd
  • layout.graphopt
  • layout.norm
Examples
g <- graph.ring(10)
layout.random(g)
layout.kamada.kawai(g)
Documentation reproduced from package igraph, version 0.5.3, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.