nocad.plotting.draw_network#
- nocad.plotting.draw_network(adj, pos, ax=None, *, node_color=None, node_size=260, labels=None, label_color='white', font_size=7.5, edge_color=None, edge_width=0.9, edge_alpha=0.85, highlight=None, drivers=(), sensors=(), io_stubs=True, io_labels=True, arrow_size=9, zorder=2, curved_symmetric=True, draw_loops='ring', node_edgecolor='white', stub_length=0.16, input_labels=None, output_labels=None, shared=())[source]#
Draw a directed network with arrows, self-loops and input/output stubs.
- Parameters:
- adj
network - pos
ndarrayofshape(N, 2)ordict Positions; a NetworkX-style dictionary (node to coordinates) is accepted.
- node_color
colororlistofcolors,optional Default: colors by role (driver / sensor / both / other).
- labels
listofstrorFalse,optional Node labels (default: the node names of a networkx graph or DataFrame, else
x1, x2, ...);Falsehides them.- highlight
dictmapping(start,end)toadictofFancyArrowPatchkeywordarguments, e.g.
{(0, 1): {"color": "#009E73", "lw": 2.2}}; other edges useedge_color.- drivers, sensorsarray_like
ofint Drawn with input arrows \(u_l\to x_i\) (blue) and output arrows \(x_i\to y_k\) (vermilion) when
io_stubsis True.
- adj
- Returns:
- ax
matplotlibAxes
- ax
Examples using nocad.plotting.draw_network#
From a state-space model to the network of its state variables
From a state-space model to the network of its state variables
Maximum matching and the minimum number of driver nodes
Maximum matching and the minimum number of driver nodes
Source components: signal sharing, path finding and the exact minimum
Source components: signal sharing, path finding and the exact minimum