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:
adjnetwork
posndarray of shape (N, 2) or dict

Positions; a NetworkX-style dictionary (node to coordinates) is accepted.

node_colorcolor or list of colors, optional

Default: colors by role (driver / sensor / both / other).

labelslist of str or False, optional

Node labels (default: the node names of a networkx graph or DataFrame, else x1, x2, ...); False hides them.

highlightdict mapping (start, end) to a dict of FancyArrowPatch keyword arguments,

e.g. {(0, 1): {"color": "#009E73", "lw": 2.2}}; other edges use edge_color.

drivers, sensorsarray_like of int

Drawn with input arrows \(u_l\to x_i\) (blue) and output arrows \(x_i\to y_k\) (vermilion) when io_stubs is True.

Returns:
axmatplotlib Axes

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

Structural and numerical controllability

Structural and numerical controllability

The seven connection types

The seven connection types

Similarity of drivers, sensors and edges

Similarity of drivers, sensors and edges