Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os.path as op
- import matplotlib.pyplot as plt
- import mne
- data_path = mne.datasets.sample.data_path()
- fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif')
- evoked = mne.read_evokeds(fname, baseline=(None, 0), proj=True)
- evoked_l_aud = evoked[0]
- # restrict to magnetometers
- evoked_l_aud.pick_types(meg='mag')
- # pick the right channels
- rt_chans = [k['ch_name'] for k in evoked_l_aud.info['chs']
- if k['loc'][0] >= 0]
- rt_picks = mne.pick_channels(evoked_l_aud.info['ch_names'], rt_chans)
- # make a dataset just of right channels.
- evoked_l_aud_rt_chans = evoked_l_aud.copy()
- evoked_l_aud_rt_chans.pick_channels(rt_chans)
- # test plot_joint
- evoked_l_aud.plot_joint(times=[0.089], show=False)
- evoked_l_aud.plot_joint(times=[0.089], picks=rt_picks, show=False)
- evoked_l_aud_rt_chans.plot_joint(times=[0.089], show=False)
- plt.show()
- # what about topo plot
- evoked_l_aud.plot_topomap(times=[0.089], show=False)
- evoked_l_aud_rt_chans.plot_topomap(times=[0.089], show=False)
- plt.show()
Add Comment
Please, Sign In to add comment