iEEG electrode positions on 3d/2d plots

The electrode positions I am getting from the mayavi plot look inaccurate.

The issue is well visible in the tutorial as well: Working with ECoG data:

The electrodes plotted with scatter (colored blobs) are off compared to the ones made with plot_alignment (white spheres underneath). Reducing the radius of the scatter plot reveals how inaccurate it is:


I understand that these positions depend on the view, but both plots are made using the same viewpoint:

fig = plot_alignment(, subject=subject, subjects_dir=subjects_dir, surfaces=['pial'], coord_frame='mri')
mne.viz.set_3d_view(fig, 200, 70)
xy, im = snapshot_brain_montage(fig, montage)
xy_pts = np.vstack([xy[ch] for ch in['ch_names']])

fig, ax = plt.subplots(figsize=(5, 5))
sc = ax.scatter(*xy_pts.T, c=ts, vmin=10, vmax=100)

Is there a way to get more accurate positions or am I doing something wrong?

Any help is appreciated!

This seems like a bug in the code, can you open an issue about this on GitHub? You can just point to the example since it clearly shows a problem

Thanks for the feedback! That was my plan in case of no response indeed. Will do!

This was solved by Inaccurate iEEG electrode positions on 3d/2d plots 路 Issue #8868 路 mne-tools/mne-python 路 GitHub and MRG, FIX: Fix coordinate calculations by larsoner 路 Pull Request #8983 路 mne-tools/mne-python 路 GitHub