and then I use matplotlib.pyplot to draw the rawchannel=EEG C3-A2
I check that the EEG F3-A2 curves of these two images are completely inconsistent, So how can I use matplotlib.pyplot to draw the same renderings as raw.plot() ,thank you
Here is an example using the MNE-Python sample data. As you will see the data plotted are consistent, the difference is in the time range that is visible by default, and the scaling in the y-axis direction. If I force those to be equivalent the plots look quite similar.
import os
import matplotlib.pyplot as plt
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file, verbose=False, preload=False)
raw.crop(tmax=20).load_data()
plt.ion()
picks = 'EEG 032' # which channel to plot
scaling = 5e-4
# make figure sizes the same
fig, ax = plt.subplots(figsize=(24, 12))
mne.set_config('MNE_BROWSE_RAW_SIZE', '24,12')
# plot with matplotlib
ax.plot(raw.times, raw.get_data(picks=picks).squeeze())
ax.set(ylim=(-scaling, scaling))
# plot with MNE-Python
mne_fig = raw.pick(picks).plot(duration=raw.times[-1], scalings=dict(eeg=scaling))