plot sensor positions

Hi everyone,

I’m trying to do a simple 2D plot of a sub-selection of my eeg sensors. I’ve tried using plot_sensors(), going via plot_ch_adjacency(), and was looking into make_eeg_layout() but i can’t seem to be able to do it. I’m sure there must be a very simple way that i’m somehow managing to miss…

I’m using MNE 1.2.3 on a mac running 13.2.1.

Thanks for your help !

Hello, there are several things you could do here.

# %%
import mne

ssvep_folder = mne.datasets.ssvep.data_path()
ssvep_data_raw_path = (
    ssvep_folder / "sub-02" / "ses-01" / "eeg" / "sub-02_ses-01_task-ssvep_eeg.vhdr"
)
raw = mne.io.read_raw_brainvision(ssvep_data_raw_path, verbose=False)
raw.set_montage("easycap-M1")

# %%
# Plot all sensors
raw.plot_sensors(show_names=True, sphere="eeglab")

image

# %%
# Plot specific sensors
(
    raw
    .copy()
    .pick(["F8", "T7", "T8", "Oz", "P3", "Cz"])
    .plot_sensors(show_names=True, sphere="eeglab")
)

image

# %%
# Plot only sensors on the left hemisphere
# Here, we cannot use the "eeglab" sphere
channel_selections = mne.channels.make_1020_channel_selections(info=raw.info)
(
    raw
    .copy()
    .pick(channel_selections["Left"])
    .plot_sensors(show_names=True)
)

image

I hope this helps!

Richard

1 Like

Amazing, thanks a lot ! I had actually tried to do raw['picks'] = [mysensorselection], but it didn’t like it and i totally forgot i can do raw.pick().
Thank you (: