mne_denoise.viz.plot_grand_average_evokeds#

mne_denoise.viz.plot_grand_average_evokeds(all_evokeds, channels, time_windows=None, suptitle=None, group_order=None, group_colors=None, group_labels=None, amplitude_scale=1.0, y_label='Amplitude', x_label='Time', time_window_colors=None, time_window_alpha=0.06, panel_title_template='Grand Average at {channel}', figsize=None, fname=None, show=True)[source]#

Plot group-mean evoked responses with optional SEM bands.

Parameters:
  • all_evokeds (mapping[str, sequence[mne.Evoked]]) – Mapping from group key to subject-level evoked list.

  • channels (sequence[str]) – Channel names to plot.

  • time_windows (mapping[str, tuple[float, float]] | None) – Optional named windows to shade on each axis.

  • suptitle (str | None) – Optional figure-level title.

  • group_order (sequence[str] | None) – Explicit plotting order. If None, first-seen mapping order is used.

  • group_colors (mapping[str, str] | None) – Optional colors by group key.

  • group_labels (mapping[str, str] | None) – Optional display labels by group key.

  • amplitude_scale (float) – Multiplicative factor applied to evoked amplitudes before plotting.

  • y_label (str) – Y-axis label used for all panels.

  • x_label (str) – X-axis label used for all panels.

  • time_window_colors (mapping[str, str] | None) – Optional colors for named time_windows entries.

  • time_window_alpha (float) – Alpha used for shaded time_windows.

  • panel_title_template (str) – Format string for panel titles. Must support {channel}.

  • figsize (tuple[float, float] | None) – Figure size in inches.

  • fname (path-like | None) – Optional output path used to save the figure.

  • show (bool) – If True, display the figure.

Returns:

fig – Figure handle.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If required groups/channels are missing or lists are empty.

Notes

This function is MNE-evoked oriented and expects mne.Evoked inputs.

Examples

>>> from mne_denoise.viz import plot_grand_average_evokeds
>>> fig = plot_grand_average_evokeds(
...     all_evokeds,
...     channels=("Cz", "Pz"),
...     amplitude_scale=1.0,
...     y_label="Amplitude",
...     show=False,
... )