network_topology#
- class braintools.visualize.network_topology(adjacency, positions=None, node_colors=None, edge_colors=None, node_sizes=None, edge_widths=None, ax=None, figsize=(10, 10), layout='spring', title=None, **kwargs)#
Visualize network topology from adjacency matrix.
- Parameters:
adjacency (
ndarray) – Adjacency or signed weight matrix of the network;adjacency[i, j]is the edge from nodeito nodej. Every non-zero entry is drawn as a line (edge direction is not shown). Withoutedge_colors, positive edges are gray and negative (e.g. inhibitory) edges blue.positions (
ndarray|None) – Node positions (N, 2). If None, uses layout algorithm.edge_colors (
ndarray|None) – Colors for edges: a single color, one color per drawn edge (in row-major order of the adjacency matrix), or an(N, N)/ flattenedN*Narray indexed likeadjacency.edge_widths (
float|ndarray|None) – Widths for edges, in the same formats asedge_colors; an(N, N)weight matrix can be passed directly (its absolute values are used).ax (
Axes|None) – Axes to plot on.figsize (
Tuple[float,float]) – Figure size if creating new figure.layout (
str) – Layout algorithm: ‘spring’, ‘circular’, ‘random’.**kwargs – Additional arguments passed to scatter (for nodes).
- Returns:
ax – The axes object containing the plot.
- Return type:
Axes
See also
braintools.visualize.morphology.plot_topology_graphDraw a discrete neuron topology (branches, control volumes, solver nodes) as a graph.