Wrapper for plot.network with appropriate defaults to plot a highlighted path, or over-plot highlighted paths on a on top of a static aggregate network plot.
paths: a tPath object containing temporal path (presumably extracted from nd) to be plotted over the network, or a list of paths to be plotted together on the same network.
path.col: vector of valid colors (possibly transparent) to be used for each path. Default will created semi-transparent colors from the rainbow palette.
x: object (assumed to be tPath) to be plotted on top of a static aggregate network plot
...: additional arguments to be passed to plot.network and plot.tPath.
coord: optional numeric matrix of coordinates for positioning vertices. See plot.network
edge.col: color for drawing edges (paths). See plot.network
edge.label.col: color for edge labels. Default to same color as edges. See plot.network
edge.lwd: numeric expansion factor for edge line widths. See plot.network
edge.label.cex: numeric expansion factor for edge labels. See plot.network
displaylabels: logical, should vertex labels be included on the plot? See plot.network
displayisolates: logical, should isolated vertices be included in the plot? See plot.network
jitter: adds random noise to positions (disabled by default) See plot.network
vertex.lwd: Vertex border line with. See plot.network
vertex.cex: Vertex expansion factor. Default is to scale up the origin vertex for the path, and not draw the other vertices. See plot.network
vertex.col: Color for vertices. Default is to leave them un-colored. See plot.network
Details
plotPaths plots the networkDynamic object using the normal plot.network function and ... arguments. Then calls plot.tPath for each tPath object in paths to over-plot the edges of path onto the network plot using the corresponding path.col color. Use of semi-transparent colors can help (somewhat) improve readability when paths overlap on the same edges.
plot.tPath plots the path information encoded in a single tPath object. It first creates a network using as.network.tPath and then calls plot.network with suitable defaults for drawing (or over-drawing) the path (doesn't display isolated vertices, draws times as edge labels, draws a color around the source vertex, etc. )
Returns
Generates a network plot with a highlighted path, invisibly returns the plot coordinates.
Author(s)
skyebend
See Also
See also tPath
Examples
data(moodyContactSim)v10path<-tPath(moodyContactSim,v=10,start=0)# plot just the path from v10plot(v10path)# plot the path from v10 on top of the networkplotPaths(moodyContactSim,v10path)# plot the paths from both v10 and v1v1path<-tPath(moodyContactSim,v=1,start=0)plotPaths(moodyContactSim,list(v10path,v1path))# if ndtv package is installed, along with Graphviz system library,# nice hierarchical trees can be drawn## Not run:plot(v10path, coord=network.layout.animate.Graphviz( as.network(v10path), layout.par = list(gv.engine='dot')), jitter=FALSE)## End(Not run)