mne_denoise.viz.plot_component_summary#

mne_denoise.viz.plot_component_summary(estimator, data=None, info=None, picks=None, times=None, sfreq=None, n_components=None, psd_fmax=None, show=True, plot_ci=True, fname=None)[source]#

Plot a compact per-component summary dashboard.

Each selected component is displayed in one row with: 1) spatial pattern, 2) time course (mean ± CI for epoched sources), 3) power spectral density.

Parameters:
  • estimator (object) – Fitted estimator exposing component patterns and a transform/source API.

  • data (mne.io.BaseRaw | mne.BaseEpochs | ndarray | None) – Input data used to compute component sources when they are not cached.

  • info (mne.Info | None) – Sensor metadata for topomap rendering.

  • picks (array-like of int | None) – Channel indices used for topomap rendering. If None, the pattern panel uses a text placeholder instead of topomaps.

  • times (array-like of shape (n_times,) | None) – Explicit time coordinates for source time-course panels. If None, sample indices are used.

  • sfreq (float | None) – Sampling frequency used for PSD computation when info is not available. Required if info cannot be resolved.

  • n_components (int | sequence of int | None) – Components to plot. If None, plot up to five components.

  • psd_fmax (float | None) – Maximum frequency (Hz) shown in the PSD column. If None, defaults to min(100, sfreq / 2) to preserve previous behavior.

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

  • plot_ci (bool, default=True) – If True and sources are epoched, overlay a 95% CI band based on SEM.

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

Returns:

fig – Figure handle.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If no components are selected, if psd_fmax is not positive, if times length mismatches source length, or if picks is provided without valid info. Also raised when neither info nor sfreq is provided.

Notes

Topomap rendering and time coordinates are explicit in this function. It does not infer channel picks or time axes.

Examples

>>> from mne_denoise.viz import plot_component_summary
>>> fig = plot_component_summary(
...     estimator,
...     data=epochs,
...     sfreq=epochs.info["sfreq"],
...     info=info,
...     picks=[0, 1, 2, 3],
...     times=epochs.times,
...     n_components=3,
...     psd_fmax=80,
...     show=False,
... )