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_original
mne.io.Raw
Original raw EEG data before cleaning.
- raw_cleaned
mne.io.Raw
Cleaned raw EEG data after preprocessing.
- output_path
str
,Path
,or
None
,default
None
Path to save the plot. If None, plot is not saved.
- title
str
,default
“RawData
Comparison:Original
vs
Cleaned” Title for the plot.
- downsample_to
float
,default
100.0 Target sampling rate for plotting (Hz). Data is downsampled to reduce file size and improve rendering speed.
- scaling_factor
float
,default
2.0 Amplitude scaling factor for better visibility.
- spacing
float
,default
10.0 Vertical spacing between channels.
- figsize
tuple
orNone
,default
None
Figure size (width, height). If None, calculated automatically.
- verbosebool or
None
,default
None
Control verbosity of output.
- raw_original
- Returns:
- fig
matplotlib.figure.Figure
The created figure object.
- fig
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")