mne_denoise.viz.plot_signal_diagnostics_summary#

mne_denoise.viz.plot_signal_diagnostics_summary(signals, *, channel, times, group_order, reference_group, group_colors, group_labels, channel_names=None, channel_label=None, windows=None, title='Signal Diagnostics Summary', show=True, fname=None)[source]#

Plot grouped time-domain signal diagnostics.

Parameters:
  • signals (mapping[str, array-like | MNE object]) – Mapping from group name to signal data. Each value must be 2D (n_channels, n_times) or 3D (n_epochs, n_channels, n_times).

  • channel (int | str) – Channel selector. String selectors require explicit channel_names.

  • times (array-like of shape (n_times,)) – Explicit time axis.

  • channel_names (sequence of str | None) – Explicit channel names used for string channel selectors and channel labeling. The function does not infer names from MNE inputs.

  • channel_label (str | None) – Explicit channel label when channel_names is not provided.

  • group_order (sequence of str) – Explicit group plotting order.

  • reference_group (str) – Explicit reference group used for the difference panel.

  • group_colors (mapping) – Explicit color and display-label mappings keyed by group.

  • group_labels (mapping) – Explicit color and display-label mappings keyed by group.

  • windows (sequence of tuple[float, float, str] | None) – Optional highlighted windows. Each entry must be (start, stop, label).

  • title (str) – Figure title.

  • show (bool) – Whether to show the figure.

  • fname (path-like | None) – Optional output path.

Returns:

fig – Figure handle.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If signals is empty, times is shape-incompatible, channel metadata is insufficient for the requested selector, or group ordering is invalid.

Notes

This is a strict explicit API: group_order, reference_group, group_colors, and group_labels are caller-owned inputs.

Examples

>>> import numpy as np
>>> from mne_denoise.viz import plot_signal_diagnostics_summary
>>> rng = np.random.default_rng(0)
>>> n_times = 200
>>> times = np.arange(n_times) / 200.0
>>> signals = {
...     "before": rng.standard_normal((3, n_times)),
...     "after": rng.standard_normal((3, n_times)),
... }
>>> fig = plot_signal_diagnostics_summary(
...     signals,
...     channel=1,
...     channel_label="C2",
...     times=times,
...     group_order=["before", "after"],
...     reference_group="before",
...     group_colors={"before": "#4C72B0", "after": "#55A868"},
...     group_labels={"before": "Before", "after": "After"},
...     windows=[(0.08, 0.14, "early")],
...     show=False,
... )