-
layout __igraph
Generate coordinates for plotting
graphs
1
Description
Some simple and not so simple functions
determining the placement of the vertices for
drawing a graph.
2
Usage
1)
(graph, dim=2, ...)
2)
(graph, params, dim=2)
3)
(graph, params)
4)
(graph, params)
5)
ld(graph, ..., dim=2, params)
6)
(graph, ..., dim=2,
params)
7)
(graph, ...,
params)
8)
d(graph, ...,
params)
9)
(graph, ...,
params)
10)
(graph, ...,
params)
11)
pt(graph, ...,
params=list())
12)
(graph,
d=(graph), ...)
13)
(layout,
xmin = NULL, xmax = NULL, ymin = NULL, ymax =
NULL,
i.
zmin = NULL, zmax =
NULL)
3
Arguments
graph
The graph to place.
params
第
1
页
,
共
11
页
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.
For these extra parameters are simply
passed to the real layout function, if one is
called.
d
The
matrix used for singular value decomposition. 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.
4
Details
These
functions calculate the coordinates of the
vertices for a graph usually based on some
optimality criterion.
4.1
tries to choose an
appropriate layout function for the supplied
graph, and uses that to generate
the
layout. The current implementations works like
this:
第
2
页
,
共
11
页
the graph has
a graph attribute called ?layout?, then this is
used. If this attribute is an R
function, then it is called, with the
graph and any other extra arguments.
ise,
if
the
graph
has
vertex
attributes
called
?x?
and
?y?,
then
these
are
used
as
coordinates. If the graph has an
additional ?z? vertex attribute, that is also
used.
ise,
if
the
graph
is
connected
and
has
less
than
100
vertices,
the
Kamada-Kawai
layout is used,
by calling .
ise, if the graph has less
than 1000 vertices, then the Fruchterman-Reingold
layout is
used, by calling ld.
ise the DrL layout is used, is called.
4.2
simply places the vertices randomly on
a square. It has no parameters.
4.3
places the
vertices on a unit circle equidistantly. It has no
paramaters.
4.4
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.
4.5
ld
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).
第
3
页
,
共
11
页
maxdelta
aximumchange (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).
minx
If
not
NULL,
then
it
must
be
a
n
umeric
vector
that
gives
lower
boundaries
for
the
?x?
coordinates of the vertices. The length
of the vector must match the number of vertices in
the
graph.
maxx
Similar to minx, but gives the upper
boundaries.
miny
Similar to
minx, but gives the lower boun
daries of
the ?y? coordinates.
maxy
Similar to minx, but gives the upper
boundaries of the ?y? coordinates.
minz
Similar to minx, but
gives the lower boundaries of the ?z? coordinates,
if the dim argument is 3.
Otherwise it
is ignored.
maxz
Similar to
minx
, but gives the upper boundaries of
the ?z? coordinates, if the dim argument is 3.
Otherwise it is ignored.
start
If given, then it
should be a matrix with two columns and one line
for each vertex. This matrix
will be
used as starting positions for the algorithm. If
not given, then a random starting matrix is
used.
This function was
ported from the
SNA
package.
第
4
页
,
共
11
页
4.6
is another force based
algorithm. Parameters and default values:
niter
Number of iterations
to perform (1000).
sigma
Sets the base standard deviation of
position change proposals (vcount(graph)/4).
initemp
The initial
temperature (10).
coolexp
The cooling exponent (0.99).
kkconst
Sets the Kamada-
Kawai vertex attraction constant
(vcount(graph)**2).
minx
If
not
NULL,
then
it
must
be
a
numeric
vector
that
gives
lower
boundaries
for
the
?x?
coordinates of the vertices. The length
of the vector must match the number of vertices in
the
graph.
maxx
Similar
to
minx,
but
gives
the
upper
milar
to
minx,
but
gives
the
lower
boundaries of the ?y?
coordinates.
maxy
Similar to minx, but gives the upper
boundaries of the ?y? coordinates.
minz
Similar to minx, but
gives the lower boundaries of the ?z? coordinates,
if the dim argument is 3.
Otherwise it
is ignored.
maxz
Similar to
minx, but gives the upper boundaries of
the ?z? coordinates, if the dim argument is 3.
Otherwise it is ignored.
start
第
5
页
,
共
11
页
-
-
-
-
-
-
-
-
-
上一篇:曾经有一份真诚的爱情放在我面前
下一篇:Unity之工作总结