| plot.dynet | R Documentation |
Nine views, each answering a different question.
"events"Every contact as a link drawn at the moment it fires, with actors on the vertical axis. A link leaves its source in the source's colour and arrives in the target's.
"timeline"Edge activity as an intensity heatmap, one row per pair. This is the view a static network cannot give you: it shows at a glance whether the network was busy throughout or concentrated in a few bursts.
"activity"Edges forming and dissolving over time.
"network"The network as a node-link diagram, drawn by
cograph::splot(). With no at, the whole window is flattened into one
picture – useful as a reference point, and as a reminder of how much it
overstates, since every tie appears simultaneous. With at, only that
time bin is drawn.
"snapshots"Small multiples, one cograph::splot() per time
bin, laid out on shared coordinates so positions are comparable across
panels.
"layers"The multilayer view: one network per time slice, drawn
as a stack of layers in which each vertex appears once per slice and is
joined to its own copy in the next by an identity arc of weight
omega.
"heatmap"The matrix counterpart of "layers": each slice is a
tilted heatmap plane rather than a node-link diagram.
"stack"The same slices projected as a node-link stack, each vertex keeping one colour through the whole stack so it can be followed between planes.
"proximity"Vertices placed on a vertical line at each time point according to how close they are in the network, and joined through time. Clusters appear as bands of lines travelling together.
All node-link rendering is cograph's. A dynet object is a cograph
netobject, so cograph::splot(dn) works directly and every one of its
rendering arguments is available here through ....
## S3 method for class 'dynet'
plot(
x,
type = c("timeline", "events", "activity", "network", "snapshots", "proximity",
"layers", "heatmap", "stack"),
at = NULL,
start = NULL,
end = NULL,
top = 40L,
step = NULL,
omega = 1,
bins = NULL,
link = c("hook", "arc", "chevron", "wave", "bracket"),
time = c("bin", "event", "clock"),
aggregate = TRUE,
nest = c("pair", "column"),
split = 0.8,
blend = FALSE,
weight = TRUE,
node_size = NULL,
node_shape = NULL,
node_fill = NULL,
node_border_color = NULL,
node_border_width = NULL,
node_alpha = NULL,
edge_color = NULL,
edge_alpha = NULL,
edge_width = NULL,
edge_width_range = NULL,
edge_style = NULL,
edge_start_style = NULL,
edge_start_length = NULL,
curvature = NULL,
curve_pivot = NULL,
label_size = NULL,
label_color = NULL,
label_fontface = NULL,
panels = 9L,
measure = "degree",
phases = NULL,
networks = TRUE,
events = TRUE,
labels = TRUE,
highlight = NULL,
slices = 120L,
window = NULL,
flow = 2L,
palette = "okabe",
default_dist = 2,
base_size = 12,
style = .dyn_style(),
...
)
x |
A temporal network from |
type |
One of |
at |
For |
start, end |
Window the plot to |
top |
For the timeline, draw only the |
step |
Width of one time bin, in the network's time unit. For
|
omega |
For |
bins |
Number of equal time bins for |
link |
Link glyph for |
time |
Time axis for |
aggregate |
For |
nest |
For |
split |
For |
blend |
For |
weight |
For |
node_size, node_shape, node_fill, node_border_color, node_border_width, node_alpha |
Node aesthetics, named as in |
edge_color, edge_alpha, edge_width, edge_width_range, edge_style |
Link
aesthetics, named as in |
edge_start_style, edge_start_length |
How the origin of each link is
marked, named as in |
curvature, curve_pivot |
Bow geometry, as in |
label_size, label_color, label_fontface |
Axis label aesthetics, named as
in |
panels |
For snapshots, the maximum number of panels to draw, 9 by default. Bins are sampled evenly across the window and the choice is reported. |
measure |
For the proximity view, the node-level measure that line
thickness follows, |
phases |
For the proximity view, how many phases to split the window
into for the network panels. |
networks |
Whether the proximity view draws a network panel per phase,
|
events |
Whether the proximity view marks the times edges formed,
|
labels |
Whether vertices are named, |
highlight |
Vertex names to draw in colour in the proximity view, with
the rest in grey. |
slices |
How many times the proximity view measures the network across
the window, 120 by default. Smoothness comes from measuring often, never
from interpolation. |
window |
Width of each proximity slice. |
flow |
How many corner-cutting passes round each proximity line, 2 by
default. Rounding only ever takes convex combinations of measurements, so
it softens the joints without letting the curve overshoot one. |
palette |
Colours for vertices and lines: |
default_dist |
Distance assumed between vertices with no path between
them, in the proximity view. |
base_size |
Base font size for the |
style |
Style constants for the proximity view's base-graphics panel:
a list holding |
... |
Passed to the renderer the chosen view uses: |
The node-link views set a few of cograph::splot()'s defaults before
handing over: they draw no edge labels and no edge-colour legend
(legend_edge_colors = FALSE, against cograph::splot()'s own TRUE),
colour edges a neutral grey, and size nodes and arrowheads from the vertex
count. Naming any of those through ... overrides it.
Failures are classed conditions. dynet_bad_input covers every malformed
argument, dynet_unknown_plot_arg a name in ... no view can read,
dynet_bad_palette an unusable palette, and dynet_empty_result a
window, an at or a step that leaves nothing to draw. The proximity view
adds dynet_unknown_measure and dynet_needs_directed. With cograph
absent, the node-link views raise dynet_needs_cograph and the
"layers", "heatmap" and "stack" views dynet_missing_package.
For "timeline", "events", "activity" and "heatmap", a
ggplot object, which prints itself when the call is not assigned. For
"network", "snapshots", "layers", "stack" and "proximity", the
figure is drawn on the current device and the network is returned
invisibly – x itself, or the windowed network when start or end
was given.
Okabe, M., & Ito, K. (2008). Color universal design: how to make figures and presentations that are friendly to colorblind people.
Chaikin, G. M. (1974). An algorithm for high-speed curve generation. Computer Graphics and Image Processing, 3(4), 346-349.
dn <- dynet(school_contacts)
plot(dn)
plot(dn, type = "proximity")
plot(dn, type = "proximity", measure = "betweenness", phases = 4)
plot(dn, type = "network", node_fill = "#56B4E9")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.