connectivity_3d#
- class braintools.visualize.connectivity_3d(source_positions, target_positions, connections, connection_strengths=None, node_colors=None, node_sizes=None, edge_alpha=0.6, ax=None, figsize=(12, 10), title=None, connection_format='auto', **kwargs)#
Visualize 3D connectivity between neural populations.
- Parameters:
source_positions (
ndarray) – 3D positions of source nodes.target_positions (
ndarray) – 3D positions of target nodes.connections (
ndarray) – Connectivity matrix of shape(n_source, n_target)or a sequence of(source_idx, target_idx)pairs of shape(n, 2).connection_strengths (
ndarray|None) – Strength of each connection for line thickness.node_colors (
ndarray|None) – Colors for nodes.node_sizes (
ndarray|None) – Sizes for nodes.edge_alpha (
float) – Alpha transparency for connections.ax (
Axes3D|None) – 3D axes to plot on.figsize (
Tuple[float,float]) – Figure size if creating new figure.connection_format (
str) – How to readconnections.'auto'dispatches on the shape. The one ambiguous case –n_target == 2and exactlyn_sourceconnections, so the shape(n_source, 2)fits both forms – is resolved by container type: a list/tuple (or 1-D object array) is read as pairs, an ndarray as a matrix with a warning. Pass'matrix'or'pairs'to be explicit.**kwargs – Additional arguments passed to scatter.
- Returns:
ax – The 3D axes object.
- Return type:
Axes3D