View source: R/visualization.R

gplot3d | R Documentation |

`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)

`dat` |
a graph or set thereof. This data may be valued. |

`g` |
integer indicating the index of the graph (from |

`gmode` |
string indicating the type of graph being evaluated. |

`diag` |
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. |

`label` |
a vector of vertex labels; setting this to a zero-length string (e.g., |

`coord` |
user-specified vertex coordinates, in an |

`jitter` |
boolean; should vertex positions be jittered? |

`thresh` |
real number indicating the lower threshold for tie values. Only ties of value > |

`mode` |
the vertex placement algorithm; this must correspond to a |

`displayisolates` |
boolean; should isolates be displayed? |

`displaylabels` |
boolean; should vertex labels be displayed? |

`xlab` |
X axis label. |

`ylab` |
Y axis label. |

`zlab` |
Z axis label. |

`vertex.radius` |
vertex radius, relative to the baseline (which is set based on layout features); may be given as a vector, if radii vary across vertices. |

`absolute.radius` |
vertex radius, specified in absolute terms; this may be given as a vector. |

`label.col` |
color for vertex labels; may be given as a vector, if labels are to be of different colors. |

`edge.col` |
color for edges; may be given as a vector or adjacency matrix, if edges are to be of different colors. |

`vertex.col` |
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 |

`edge.alpha` |
alpha (transparency) values for edges; may be given as a vector or adjacency matrix, if edge transparency is to vary. |

`vertex.alpha` |
alpha (transparency) values for vertices; may be given as a vector, if vertex transparency is to vary. |

`edge.lwd` |
line width scale for edges; if set greater than 0, edge widths are rescaled by |

`suppress.axes` |
boolean; suppress plotting of axes? |

`new` |
boolean; create a new plot? If |

`bg.col` |
background color for display. |

`layout.par` |
list of parameters to the |

`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.

A three-column matrix containing vertex coordinates

`rgl`

Carter T. Butts buttsc@uci.edu

Wasserman, S. and Faust, K. (1994) *Social Network Analysis: Methods and Applications.* Cambridge: Cambridge University Press.

`gplot`

, `gplot3d.layout`

, `rgl`

## 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)) ## End(Not run)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.