Is there any way to fix topomap plot with mne library in python?

Hi, I am trying to plot topo map with mne library, but I don’t know why the figure does not contain contour/outlier and nose and ears. Anyone can help me with this issue?
My code is here:

import mne
fname = "oddball-epo.fif"

epochs = mne.read_epochs(fname,preload=True)

target = epochs["target"].average()
target

standard = epochs["standard"].average()

target.plot_joint()

times = [0, 0.1, 0.2, 0.3, 0.4, 0.5]
times1 = [-0.2,-0.1,0,0.1, 0.2, 0.3, 0.4, 0.5]
target.plot_joint(times)
target.plot_topomap(times1, ch_type='eeg')
target.plot_joint(times1)

Resulting images


Expected result

1 Like

If you zoom in on one of the topoplots you will see that the head is about the same size as the Cz channel. This is usually caused by wrong units of the channel positions. For example reading EEGLAB .set files likely still incorrectly reads the units of channel position: EEGLAB uses cm but mne assumes meters. As you can expect this leads to channels being meters apart, and the head outline is thus so small it is impossible to see.

To fix this issue you can manipulate the sphere argument to increase the radius of the sphere used to draw the head outline. You can also use a small function fix_ch_pos I have here: sarna/utils.py at master · mmagnuski/sarna · GitHub

But it would be good to fix the incorrect readout of channel position units. Is it possible that you read the data from .set file format before saving to .fif?
In any case, I will try to fix the units issue with eeglab files tomorrow.

1 Like