mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

[WIP, FIX] make plot_sensors and plot_topomap omit channels without positions (nan)

Open mmagnuski opened this issue 2 years ago • 1 comments

Currently sensors without position are shown at (0, 0) position when using mne.viz.plot_sensors - this can lead to multiple channels being at the same location (look at the middle part below): image

but in general it may be confusing to plot channels without know position as if they were at the Cz location. This is an attempt to fix that - I'll see what I break as a consequence. :)

One thing I'm considering: Should there be a warning if some channel positions are missing?

TODO:

  • [x] fix things that I broke
    • [x] kind='3d'
    • [x] plot_topomap
  • [x] test
  • [x] whats new
  • [ ] add warning when channel positions are missing?

mmagnuski avatar Jun 03 '22 13:06 mmagnuski

Before this PR, not dropping channels with undefined position could result in weird plots like this one: 01_weird maybe thats an interesting idea for an mne logo, but it does not represents underlying data well. After dropping one channel without position the same plot_topomap call gives: 02_after_dropping_nan_pos

This PR fixes the problem, but somehow introduces another: now the extrapolate='local' seems to have different image cropping limits, I'll have to investigate more. 03_on_pr

mmagnuski avatar Jun 05 '22 16:06 mmagnuski