Plotting primitives#

Drawing primitives for networks of state variables.

All functions accept an optional ax and return the Axes they drew on; they never call plt.show(). Roles have fixed colors in every figure of the package and the book: driver nodes and inputs blue, sensor nodes and outputs vermilion, nodes that are both purple, matched edges green, other states gray (Okabe–Ito palette).

Network drawing, role colors and layouts.

Functions#

default_layout(adj[, random_state, scale, ...])

Node positions for a network drawing.

as_pos_dict(pos[, G])

NetworkX-style pos dictionary from an (N, 2) array.

draw_network(adj, pos[, ax, node_color, ...])

Draw a directed network with arrows, self-loops and input/output stubs.

plot_network(adj[, drivers, sensors, ...])

Draw a network with its driver and sensor nodes and, optionally, a matching.

role_colors(n[, drivers, sensors, base])

Node colors by role (driver, sensor, both, other).

legend_handles([kinds])

Legend entries for the role colors.

Constants#

PALETTE

Okabe–Ito color-blind-safe palette, fixed assignment order.

ROLE_COLORS

Fixed colors of node roles and edge kinds.

LAYOUTS

Layouts accepted by default_layout().