plotting.plot_raw_comparison#

autoclean.functions.visualization.plotting.plot_raw_comparison(raw_original, raw_cleaned, output_path=None, title='Raw Data Comparison: Original vs Cleaned', downsample_to=100.0, scaling_factor=2.0, spacing=10.0, figsize=None, verbose=None)[source]#

Plot raw data comparison showing original vs cleaned data overlay.

This function creates a multi-channel plot comparing original and cleaned EEG data, with original data in red and cleaned data in black. The plot shows all channels over the full duration with proper scaling and spacing.

Parameters:
raw_originalmne.io.Raw

Original raw EEG data before cleaning.

raw_cleanedmne.io.Raw

Cleaned raw EEG data after preprocessing.

output_pathstr, Path, or None, default None

Path to save the plot. If None, plot is not saved.

titlestr, default “Raw Data Comparison: Original vs Cleaned”

Title for the plot.

downsample_tofloat, default 100.0

Target sampling rate for plotting (Hz). Data is downsampled to reduce file size and improve rendering speed.

scaling_factorfloat, default 2.0

Amplitude scaling factor for better visibility.

spacingfloat, default 10.0

Vertical spacing between channels.

figsizetuple or None, default None

Figure size (width, height). If None, calculated automatically.

verbosebool or None, default None

Control verbosity of output.

Returns:
figmatplotlib.figure.Figure

The created figure object.

See also

plot_ica_components

Visualize ICA components

plot_psd_topography

Create PSD topography plots

mne.viz.plot_raw

MNE raw data plotting functions

Examples

>>> fig = plot_raw_comparison(raw_original, raw_cleaned)
>>> fig = plot_raw_comparison(raw_original, raw_cleaned, output_path="comparison.png")