# iEEG electrode positions on 3d/2d plots

**URL:** <https://mne.discourse.group/t/ieeg-electrode-positions-on-3d-2d-plots/2687>\
**Category:** Support & Discussions\
**Tags:** ieeg-and-ecog, visualization\
**Created:** [February 10, 2021, 5:57pm UTC](https://mne.discourse.group/t/ieeg-electrode-positions-on-3d-2d-plots/2687 "2021-02-10T17:57:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Immiora](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/immiora/32/182_2.png) [@Immiora](https://mne.discourse.group/u/Immiora)\
**Post date:** [February 10, 2021, 5:57pm UTC](https://mne.discourse.group/t/ieeg-electrode-positions-on-3d-2d-plots/2687/1 "2021-02-10T17:57:21Z")

</div>

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](https://mne.tools/dev/auto_tutorials/misc/plot_ecog.html#sphx-glr-auto-tutorials-misc-plot-ecog-py):

 ![sphx_glr_plot_ecog_002](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/ce01e0041af17be9ddfd51a6711e36faf532879c.png)

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:

![Capture](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/17ab5e455b0fe5c66e058f19d7665bc7d936fcd9.png)

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

```python
fig = plot_alignment(raw_car.info, 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 raw_car.info['ch_names']])

fig, ax = plt.subplots(figsize=(5, 5))
ax.imshow(im)
ax.set_axis_off()
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!

---

<div class="post-metadata">

**Author:** ![larsoner](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/larsoner/32/3_2.png) [@larsoner](https://mne.discourse.group/u/larsoner)\
**Post date:** [February 12, 2021, 6:35pm UTC](https://mne.discourse.group/t/ieeg-electrode-positions-on-3d-2d-plots/2687/2 "2021-02-12T18:35:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Immiora](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/immiora/32/182_2.png) [@Immiora](https://mne.discourse.group/u/Immiora)\
**Post date:** [February 12, 2021, 6:56pm UTC](https://mne.discourse.group/t/ieeg-electrode-positions-on-3d-2d-plots/2687/3 "2021-02-12T18:56:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![drammock](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/drammock/32/4_2.png) [@drammock](https://mne.discourse.group/u/drammock)\
**Post date:** [June 3, 2021, 10:28pm UTC](https://mne.discourse.group/t/ieeg-electrode-positions-on-3d-2d-plots/2687/4 "2021-06-03T22:28:20Z")

</div>

This was solved by [Inaccurate iEEG electrode positions on 3d/2d plots · Issue #8868 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/issues/8868) and [MRG, FIX: Fix coordinate calculations by larsoner · Pull Request #8983 · mne-tools/mne-python · GitHub](https://github.com/mne-tools/mne-python/pull/8983)
