dirconn.viz.connectivity_grids#

dirconn.viz.connectivity_grids(results: Sequence[Connectivity], names: Sequence[str] | None = None, *, ncols: int | None = None, freq: float | None = None, band: str | Sequence[float] | None = None, time: float | None = None, cmap: Any = None, vmin: float | None = None, vmax: float | str | None = None, label: str | None = None, annotate: bool | str = 'auto', significance: Sequence[Any] | None = None, significance_style: str = 'auto', groups: Mapping[str, str] | None = None, groups_title: str | None = None, group_colours: Mapping[str, Any] | None = None, figsize: tuple[float, float] | None = None) → ndarray#

Draw several results side by side, one panel each, on one shared colour scale.

Every panel follows the rules of connectivity_grid(); the slice options apply to all.

Parameters:
  • results (sequence of Connectivity) – The results. They share the colour bar only when their measures have the same finite theoretical range (DTF and PDC: 0 to 1), or when they are the same measure with the same derivation (two DTF net directions; not GC and rPDC, whose ranges are unbounded, nor a net direction and a peak frequency).

  • names (sequence of str, optional) – One short title per panel; by default the name of each measure. When several panels would get the same name, each also names what sets it apart from the others: its derivation or its slice ("DTF, 22 Hz" and "DTF, beta band").

  • ncols (int, optional) – Panels per row; by default up to three.

  • freq – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • band – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • time – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • cmap – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • vmin – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • label – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • annotate – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • significance_style – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • groups – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • groups_title – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • group_colours – As in connectivity_grid(). The colour scale is computed from the values of all panels together.

  • vmax (float or "p95", optional) – As in connectivity_grid(), over the values of all panels.

  • significance (sequence, optional) – One entry per result: a mask, a test result or None.

  • figsize ((float, float), optional) – Width and height of the figure in inches; by default 3.4 in per column plus 1.6 in (with groups: 4.2 in per column plus 2.6 in, for the strips and the group legend), and 3.2 in per row plus 0.8 in. Give a larger figure when long node names or the numbers in the cells need more room; the numbers, marks and tick labels keep their sizes.

Returns:

One axes per result, in order.

Return type:

numpy.ndarray of matplotlib.axes.Axes

Raises:

ValueError – If the results do not share a theoretical range, or names or significance do not have one entry per result.