Learn R Programming

ndtv (version 0.13.4)

timePrism: Plot a networkDynamic object as sequence of snapshots in a pseudo-3D space-time prism

Description

Plots an image using scatterplot3d to render multiple network layout 'slices' in a '3D' orthographic projection in which one axis is time. The coordinates for the networks are assumed to have been generated by compute.animation

Usage

timePrism(nd, at, 
              spline.v = NULL, 
              spline.col = "#55555555", 
              spline.lwd = 1, 
              box = TRUE, 
              axis = TRUE, 
              planes = FALSE, 
              plane.col = "#FFFFFF99", 
              scale.y = 1, 
              angle = 20, 
              orientation = c("x", "y", "z"), 
              ...)

Value

invisibly returns the result of the scatterplot3d command, which contains useful functions as $xyz.convert which can be used to convert xyz coordinates into the plot space for additional annotation.

Arguments

nd

a networkDynamic object to be plotted

at

a numeric vector of times at which the network should be sampled and plotted.

spline.v

optional integer vector of vertex ids to highlight with a spline linking the vertices'' positions at multiple time points

spline.col

vector of colors corresponding to spline.v

spline.lwd

numeric line width for vector splines

box

a logical value indicating whether a box should be drawn around the plot to indicate its bounds

axis

a logical value indicating whether the x, y, and z axis should be drawn.

planes

a logical value indicating whether a 'plane' should be drawn to indicate the boundaries of each individual network plot

plane.col

a color value to be used to color the planes (usually partially transparent)

scale.y

numeric value giving the relative scale of y axis related to x- and z axis. (may distort network vertex shapes)

angle

numeric angle (degrees) between x and y axis (Attention: result depends on scaling).

orientation

three-element charter vector the permutation of which determines the mapping and orientation of the plot axis relative to the figure. i.e. default c('x','y','z') will place 'z' (the time dimension) 'vertically' up the page, c('z','x','y') will make the time dimension horizontal, etc.

...

additional parameters to plot.network

Author

skyebend@uw.edu

Details

Implements a common conceptualization of dynamic networks a series of 'layers' or 'slices' in time. Mostly useful for illustrative purposes as this plot type tends to get really crowded if more than a few network time points are shown, or vertices highlighted.

See Also

compute.animation,scatterplot3d, xspline, plot.network. Also filmstrip and proxmity.timeline for related static views.

Examples

Run this code
data("short.stergm.sim")
compute.animation(short.stergm.sim)
timePrism(short.stergm.sim,at=c(1,10,20),
          displaylabels=TRUE,
          label.cex=0.5)
          
data(toy_epi_sim)  
timePrism(toy_epi_sim,
          orientation=c('z','y','x'),
          angle=40,
          spline.v=c(7, 29, 36, 70, 82, 96),  # hilite the infected 
          spline.col='red',
          spline.lwd=2,
          box=FALSE,
          planes=TRUE,
          vertex.col='ndtvcol')

Run the code above in your browser using DataLab