igraph (version 0.3.3)

rglplot: 3D plotting of graphs with OpenGL

Description

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.

Usage

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, 
    ...)

Arguments

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
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 prefi
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 al
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 correspond
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 color
vertex.size
The size of the vertices. Either a numeric constant, or a numeric vector, or a string with prefix 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.

Value

  • NULL, invisibly.

Details

Note that rglplot is considered to be highly experimental. It is not very useful either.

See Also

plot.igraph for the 2D version, tkplot for interactive graph drawing in 2D.

Examples

Run this code
g <- graph.lattice( c(5,5,5) )
coords <- layout.fruchterman.reingold(g, dim=3)
rglplot(g, layout=coords)

Run the code above in your browser using DataCamp Workspace