rglplot {igraph} | R Documentation |
Using the rgl
package, rglplot
plots a graph
in 3D. The plot can be zoomed, rotated, shifted, etc. but the
coordinates of the vertices is fixed.
rglplot (x, layout = layout.random, layout.par = list(), labels = NULL, label.color = "darkblue", label.font = NULL, label.degree = -pi/4, label.dist = 0, vertex.color = "SkyBlue2", vertex.size = 15, edge.color = "darkgrey", edge.width = 1, edge.labels = NA, ...)
x |
The graph to plot. |
layout |
A function or matrix giving the coordinates of the
vertices. See the same argument of tkplot . |
layout.par |
A named list specifying the optional parameters of the layout
function, only used if the layout argument is a
function. The parameters themselves are layout function dependent,
they are discussed in the layout manual page.
|
labels |
Gives the labels to use for the vertices. It can be a
numeric or character vector. If NA the plot will have no
labels, if NULL numeric ids starting from one will be
used. If a character vector of length one with prefix
“a: ” is given then the corresponding vertex attribute
(without the “a: ” prefix) is used for the labels. |
label.color |
The color of the labels. If it is a character
scalar with prefix “a: ” then the corresponding vertex
attribute will be used. Otherwise if it is a vector of length one
then all labels will be the same color. It can also be a character
or numeric vector of the same length as the number of
vertices. Colors can be given as strings or integers, in the latter
case the actual color palette will be used. |
label.font |
The font for the labels, currently not used. |
label.degree |
Governs the placement of the vertex labels. 0
is right, pi/2 is down, pi is left. This argument can be a constant
(for all labels) or a numeric vector. If it is a constant string
with prefix “a: ” then the corresponding vertex
argument will be used. |
label.dist |
Numeric constant, gives the distance between the labels and the vertices. 1 is some “ideal” distance, based on the vertex and label sizes. Use 0 for drawing the labels on the vertices. |
vertex.color |
The color of the vertices, either a character
constant with prefix “a: ” for using an attribute or
without it: a constant color for all vertices, or a numeric or
character or numeric vector giving the different colors for the
vertices. |
vertex.size |
The size of the vertices. Either a numeric
constant, or a numeric vector, or a string with prefix
quote{a: } giving the vertex attribute to use. |
edge.color |
The color of the edges. Either a character vector
with prefix “a: ” naming the edge attribute to use or
one without it, or a numeric or character vector giving the colors
for each edge.
|
edge.width |
The width of the edges. Either a numeric constant or
a numeric vector, or a string with prefix “a: ” giving
the edge attribute to use. |
edge.labels |
Labels for the edges, this will be converted to a
character vector. The default is NA which suppresses edge
labels. The vector might contain NA 's as well to suppress
labels for some edges. |
... |
Additional arguments, none right now. |
Note that rglplot
is considered to be highly experimental. It
is not very useful either.
NULL
, invisibly.
Gabor Csardi csardi@rmki.kfki.hu
plot.igraph
for the 2D version,
tkplot
for interactive graph drawing in 2D.
## Not run: g <- graph.lattice( c(5,5,5) ) coords <- layout.fruchterman.reingold(g, dim=3) rglplot(g, layout=coords) ## End(Not run)