mne_denoise.viz.plot_component_psd_comparison#

mne_denoise.viz.plot_component_psd_comparison(inst_before, components, component_indices, sfreq=None, peak_freq=None, fmin=1, fmax=40, show=True, fname=None)[source]#

Plot input PSD next to PSDs of selected components.

Parameters:
inst_beforeMNE object | ndarray

Baseline signal used for the reference PSD.

componentsMNE object | ndarray

Component signals with canonical shape (n_components, n_times), or (n_epochs, n_components, n_times).

component_indicesint | sequence of int

Explicit component index/indices to include in the component PSD panel.

sfreqfloat | None

Sampling frequency for array inputs. If components is an MNE object and sfreq is None, components.info['sfreq'] is used.

peak_freqfloat | None

Optional frequency marker shown on both panels.

fminfloat, default=1

Lower frequency bound for PSD computation.

fmaxfloat, default=40

Upper frequency bound for PSD computation.

showbool

If True, display the figure.

fnamepath-like | None

Optional output path used to save the figure.

Returns:
figmatplotlib.figure.Figure

Figure handle.

Raises:
ValueError

If component_indices is empty/out of range or if array inputs are provided without sfreq.