Mne.viz.plot_topomap mask settings

Hi all!
I have a question about plotting topomap and masking. It is possible to get a mask that does not shows colors for not significant channels on the topomap? Now I can obtain that significant channels are marked as circles but I would like to have instead of this one something like white spaces for not significant channels instead of colors.

I woudl like to obtain something similiar to this one:


Platform:      Windows-10-10.0.19042-SP0
Python:        3.9.6 | packaged by conda-forge | (default, Jul  6 2021, 08:46:02) [MSC v.1916 64 bit (AMD64)]
Executable:    C:\Users\kubin\anaconda3\envs\mne\python.exe
CPU:           Intel64 Family 6 Model 126 Stepping 5, GenuineIntel: 8 cores
Memory:        15.8 GB

mne:           0.23.0
numpy:         1.21.0 {blas=NO_ATLAS_INFO, lapack=lapack}
scipy:         1.7.0
matplotlib:    3.4.2 {backend=module://matplotlib_inline.backend_inline}

sklearn:       0.24.2
numba:         0.53.1
nibabel:       3.2.1
nilearn:       0.8.0
dipy:          1.4.1
cupy:          Not found
pandas:        1.3.0
mayavi:        4.7.2
pyvista:       0.31.3 {pyvistaqt=0.5.0, OpenGL 4.5.0 - Build via Intel(R) Iris(R) Plus Graphics}
vtk:           9.0.1
PyQt5:         5.12.3


Hello @mkkubins,

Evoked.plot_topomap() actually comes with a mask parameter, which you can use to mask channels. However, there appears to be a bug when supplying custom time points at which to show the topographies. Here’s my example code:

# %%
from pathlib import Path
import numpy as np

import mne

sample_data_dir = Path(mne.datasets.sample.data_path())
fname = sample_data_dir / 'MEG' / 'sample' / 'sample_audvis-ave.fif'

condition = 'Left Auditory'
evoked = mne.read_evokeds(fname=fname, condition=condition)
evoked.apply_baseline((None, 0))

times = (0.090, 0.110)
mask = np.empty(
    [len(evoked.ch_names), len(times)]
mask[20, :] = True  # Only show first 20 channels

fig = evoked.plot_topomap(times=times, time_unit='s', mask=mask)

Unfortunately, this crashes for me. I have opened an issue, see Indexing error in Evoked.plot_topomap() when trying to mask channels · Issue #9611 · mne-tools/mne-python · GitHub

ok thank you!
I am using mne.viz.plot_topomap with custom data so I tink there is also the same problem

im_d,cm_d   = mne.viz.plot_topomap(delta_[0][0], place,mask=p_val_delta_[0], axes=ax[1,0],show=False,cmap=cmap,vmin=vmin_delta,vmax=vmax_delta)   
im_t,cm_t    = mne.viz.plot_topomap(theta_[0][0], place,mask=p_val_theta_[0], axes=ax[1,1],show=False,cmap=cmap,vmin=vmin_theta,vmax=vmax_theta)   
im_a,cm_a   = mne.viz.plot_topomap(alpha_[0][0], place,mask=p_val_alpha_[0], axes=ax[1,2],show=False,cmap=cmap,vmin=vmin_alpha,vmax=vmax_alpha)   
im_b,cm_b   = mne.viz.plot_topomap(beta_[0][0], place,mask=p_val_beta_[0], axes=ax[1,3],show=False,cmap=cmap,vmin=vmin_beta,vmax=vmax_beta)   
im_g,cm_g   = mne.viz.plot_topomap(gamma_[0][0], place,mask=p_val_gamma_[0], axes=ax[1,4],show=False,cmap=cmap,vmin=vmin_gamma,vmax=vmax_gamma)   
im_4,cm_4   = mne.viz.plot_topomap(d_40_[0][0], place,mask=p_val_d_40_[0], axes=ax[1,5],show=False,cmap=cmap,vmin=vmin_40,vmax=vmax_40)