mne_denoise.viz.plot_group_condition_interaction_summary#

mne_denoise.viz.plot_group_condition_interaction_summary(traces, times, errors=None, group_order=None, condition_order=None, condition_labels=None, windows=None, title='Group Condition Interaction Summary', show=True, fname=None)[source]#

Plot group-wise condition interaction traces.

Parameters:
  • traces (mapping[str, mapping[str, array-like]]) – Nested mapping group -> condition -> trace.

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

  • errors (mapping | None) – Optional nested mapping group -> condition -> standard error.

  • group_order (sequence of str | None) – Optional group order. Defaults to first-seen order.

  • condition_order (sequence of str | None) – Optional condition order. Defaults to first-seen across groups.

  • condition_labels (mapping | None) – Optional label overrides keyed by condition.

  • windows (sequence of tuple[float, float, str] | None) – Optional highlighted windows as explicit (start, stop, label) tuples.

  • 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 traces is empty, times is not 1D, or trace/error arrays do not match the expected time dimension.

Notes

Groups are rendered as separate panels and conditions as overlaid lines within each panel.

Examples

>>> import numpy as np
>>> from mne_denoise.viz import plot_group_condition_interaction_summary
>>> times = np.linspace(-0.2, 0.5, 300)
>>> traces = {
...     "before": {"A": np.sin(times), "B": np.cos(times)},
...     "after": {"A": 0.7 * np.sin(times), "B": 0.6 * np.cos(times)},
... }
>>> fig = plot_group_condition_interaction_summary(
...     traces,
...     times=times,
...     windows=[(0.08, 0.14, "w1")],
...     show=False,
... )