mne_denoise.viz.plot_channel_time_course_comparison#

mne_denoise.viz.plot_channel_time_course_comparison(inst_before, inst_after, picks, times, start=0, stop=None, before_label='Before', after_label='After', x_label='Time', show=True, fname=None)[source]#

Plot before/after channel time courses for explicit channel picks.

Parameters:
  • inst_before (MNE object | ndarray) – Inputs to compare with shape (n_channels, n_times) or (n_epochs, n_channels, n_times).

  • inst_after (MNE object | ndarray) – Inputs to compare with shape (n_channels, n_times) or (n_epochs, n_channels, n_times).

  • picks (sequence of int | sequence of str) – Channels to display. String picks require MNE inputs with ch_names.

  • start (int | None) – Optional sample-index bounds applied after resolving times.

  • stop (int | None) – Optional sample-index bounds applied after resolving times.

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

  • before_label (str) – Legend label for the first input.

  • after_label (str) – Legend label for the second input.

  • x_label (str) – X-axis label.

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

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

Returns:

fig – Figure handle.

Return type:

matplotlib.figure.Figure

Raises:

ValueError – If shapes are invalid or inconsistent, picks are invalid, or times length does not match n_times.

Examples

>>> from mne_denoise.viz import plot_channel_time_course_comparison
>>> fig = plot_channel_time_course_comparison(
...     before_array,
...     after_array,
...     picks=[0, 2],
...     times=np.arange(1000) / 250.0,
...     show=False,
... )