[BUG/MAINT] Topomap `image_interp='None'` still interpolates
See original GitHub issueIn writing https://github.com/mne-tools/mne-python/pull/10571, having values that are not spatially continuous over a topomap made for real problems with the existing interpolation methods so I added a Voronoi option. The following code uses image_interp='None' but in my mind, this is still applying an interpolation. I was planning on adding the Voronoi option to image_interp but I thought maybe it should replace None. In the matplotlib documentation, the interpolations are demonstrated on images, which makes much more sense for None, but with points, I think this behavior is unexpected–for me, I just want an option to see the raw data. I added a new opinions-wanted tag because I think this is an especially good one to hear what other people think.
import os.path as op
import mne
import matplotlib.pyplot as plt
data_path = mne.datasets.sample.data_path()
evoked =mne.read_evokeds(op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif'))[0]
evoked.pick_types(eeg=True)
evoked.apply_proj()
fig, ax = plt.subplots()
mne.viz.plot_topomap(evoked.data.mean(axis=1), evoked.info, image_interp='None', axes=ax) # still interpolates
The Voronoi plot looks like this:
Issue Analytics
- State:
- Created a year ago
- Comments:29 (29 by maintainers)

Top Related StackOverflow Question
+1 for (4) while keeping the name as (the slight misnomer)
image_interprather than rename tointerpolationby deprecationIf people really need it, there should be something like
ax.images[0].set_interpolation(...)that they can do afterward, so I’m not too worried about this@cbrnr This is what we do now (kind of), but I agree it is not ideal. The reason for current state of afairs is rather technical, I think - we do cubic interpolation on a grid, but do not waste resources to make the grid super-fine-grained (although it can be controlled by
res) if it can be linearily smoothed by matplotlib when displayed for a similar visual effect. I actually never usedimage_interpwhen plotting topomaps, and I guess many users did not, so maybe option 4 wouldn’t be so destructive as it sounds. So you can count me as +0.5 on option 4 as well. 😃