mne_denoise.viz.plot_evoked_gfp_comparison#

mne_denoise.viz.plot_evoked_gfp_comparison(inst_before, inst_after, times, ci=0.95, n_boot=1000, colors=('#333333', '#009E73'), linestyles=('-', '-'), labels=('Before', 'After'), x_label='Time', y_label='Global Field Power', title='Evoked GFP Comparison', show=True, ax=None, fname=None)[source]#

Plot GFP comparison for before/after signals.

Parameters:
  • inst_before (MNE object | ndarray) – Signal inputs to compare. Supported array shapes are (n_channels, n_times) and (n_epochs, n_channels, n_times).

  • inst_after (MNE object | ndarray) – Signal inputs to compare. Supported array shapes are (n_channels, n_times) and (n_epochs, n_channels, n_times).

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

  • ci (float | None) – Confidence level for bootstrap bands. If None, no interval is drawn. Bootstrap intervals are only computed for 3D epoched inputs.

  • n_boot (int) – Number of bootstrap resamples when ci is not None.

  • colors (tuple[str, str]) – Colors for before/after curves.

  • linestyles (tuple[str, str]) – Linestyles for before/after curves.

  • labels (tuple[str, str]) – Legend labels for before/after curves.

  • x_label (str) – X-axis label.

  • y_label (str) – Y-axis label.

  • title (str) – Panel title.

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

  • ax (matplotlib.axes.Axes | None) – Target axes. If None, create a new figure and axes.

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

Returns:

fig – Figure handle.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If input shapes are invalid, if time lengths differ between inputs, or if times length does not match n_times.

Notes

GFP is computed as RMS across channels. For 3D epoched inputs, epochs are averaged first.

Examples

>>> from mne_denoise.viz import plot_evoked_gfp_comparison
>>> fig = plot_evoked_gfp_comparison(
...     before_array, after_array, times=np.arange(500) / 250.0, show=False
... )