connectivity_matrix

connectivity_matrix#

class braintools.visualize.connectivity_matrix(weights, pre_labels=None, post_labels=None, cmap='RdBu_r', xlabel=None, ylabel=None, center_zero=True, ax=None, figsize=(8, 8), show_colorbar=True, show_values=False, value_threshold=None, title=None, **kwargs)#

Visualize connectivity matrix between neural populations.

Parameters:
  • weights (ndarray) – Connectivity weight matrix of shape (pre, post).

  • pre_labels (List[str] | None) – Labels for pre and post-synaptic populations.

  • post_labels (List[str] | None) – Labels for pre and post-synaptic populations.

  • cmap (str) – Colormap for the matrix.

  • center_zero (bool) – Whether to center colormap at zero.

  • ax (Axes | None) – Axes to plot on.

  • figsize (Tuple[float, float]) – Figure size if creating new figure.

  • show_colorbar (bool) – Whether to show colorbar.

  • show_values (bool) – Whether to show values in cells.

  • value_threshold (float | None) – Only show values above this threshold.

  • title (str | None) – Plot title.

  • **kwargs – Additional arguments passed to imshow.

Returns:

ax – The axes object containing the plot.

Return type:

Axes