mne_denoise.viz.plot_component_time_series#

mne_denoise.viz.plot_component_time_series(estimator, data=None, n_components=None, times=None, show=True, ax=None, fname=None)[source]#

Plot stacked component time series with fixed vertical offsets.

Parameters:
  • estimator (object) – Fitted estimator exposing component sources via cache or transform.

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

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

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

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

  • ax (matplotlib.axes.Axes | None) – Optional target axes. If None, a new themed figure is created.

  • 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 or if times length mismatches source length.

Notes

Each component is z-scored independently before plotting so that traces are comparable in amplitude and can be stacked with a fixed offset.

Examples

>>> from mne_denoise.viz import plot_component_time_series
>>> fig = plot_component_time_series(
...     estimator,
...     data=raw,
...     times=raw.times,
...     show=False,
... )