gplot3d
produces a three-dimensional plot of graph g
in set dat
. A variety of options are available to control vertex placement, display details, color, etc.
gplot3d(dat, g = 1, gmode = "digraph", diag = FALSE,
label = NULL, coord = NULL, jitter = TRUE, thresh = 0,
mode = "fruchtermanreingold", displayisolates = TRUE,
displaylabels = !missing(label), xlab = NULL, ylab = NULL,
zlab = NULL, vertex.radius = NULL, absolute.radius = FALSE,
label.col = "gray50", edge.col = "black", vertex.col = NULL,
edge.alpha = 1, vertex.alpha = 1, edge.lwd = NULL, suppress.axes = TRUE,
new = TRUE, bg.col = "white", layout.par = NULL)
a graph or set thereof. This data may be valued.
integer indicating the index of the graph (from dat
) which is to be displayed.
string indicating the type of graph being evaluated. "digraph"
indicates that edges should be interpreted as directed; "graph"
indicates that edges are undirected;"twomode"
indicates that data should be interpreted as two-mode (i.e., rows and columns are distinct vertex sets).
boolean indicating whether or not the diagonal should be treated as valid data. Set this true if and only if the data can contain loops.
a vector of vertex labels; setting this to a zero-length string (e.g., ""
) omits
user-specified vertex coordinates, in an NCOL(dat)
x3 matrix. Where this is specified, it will override the mode
setting.
boolean; should vertex positions be jittered?
real number indicating the lower threshold for tie values. Only ties of value >thresh
are displayed.
the vertex placement algorithm; this must correspond to a gplot3d.layout
function.
boolean; should isolates be displayed?
boolean; should vertex labels be displayed?
X axis label.
Y axis label.
Z axis label.
vertex radius, relative to the baseline (which is set based on layout features); may be given as a vector, if radii vary across vertices.
vertex radius, specified in absolute terms; this may be given as a vector.
color for vertex labels; may be given as a vector, if labels are to be of different colors.
color for edges; may be given as a vector or adjacency matrix, if edges are to be of different colors.
color for vertices; may be given as a vector, if vertices are to be of different colors. By default, red is used (or red and blue, if gmode=="twomode"
).
alpha (transparency) values for edges; may be given as a vector or adjacency matrix, if edge transparency is to vary.
alpha (transparency) values for vertices; may be given as a vector, if vertex transparency is to vary.
line width scale for edges; if set greater than 0, edge widths are rescaled by edge.lwd*dat
. May be given as a vector or adjacency matrix, if edges are to have different line widths.
boolean; suppress plotting of axes?
boolean; create a new plot? If new==FALSE
, the RGL device will not be cleared prior to adding vertices and edges.
background color for display.
list of parameters to the gplot.layout
function specified in mode
.
A three-column matrix containing vertex coordinates
gplot3d
is the three-dimensional companion to gplot
. As with the latter, clever manipulation of parameters can allow for a great deal of flexibility in the resulting display. (Displays produced by gplot3d
are also interactive, to the extent supported by rgl
.) If vertex positions are not specified directly using coord
, vertex layout is determined via one of the various available algorithms. These should be specified via the mode
argument; see gplot3d.layout
for a full list. User-supplied layout functions are also possible - see the aforementioned man page for details.
Note that where gmode=="twomode"
, the supplied two-mode graph is converted to bipartite form prior to computing coordinates (assuming it is not in this form already). It may be desirable to use parameters such as vertex.col
to differentiate row and column vertices; by default, row vertices are colored red, and column vertices blue.
Wasserman, S. and Faust, K. (1994) Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.
# NOT RUN {
# }
# NOT RUN {
#A three-dimensional grid...
gplot3d(rgws(1,5,3,1,0))
#...rewired...
gplot3d(rgws(1,5,3,1,0.05))
#...some more!
gplot3d(rgws(1,5,3,1,0.2))
# }
Run the code above in your browser using DataLab