Mne.viz.plot_topomap plot multiple figures

When I use mne.viz.plot_topomap to plot multiple topomap in one figure. Only the first plot will be displayed as shown below.

The code to generate the plot is shown as below with axs[i] been the argument for the axes

fig, axs = plt.subplots(1, 2)
mne.viz.plot_topomap(fbcsp.fbcsp_filters_multi[0][i]['u_mat'][0], x.info, axes = axs[0], show = True)
mne.viz.plot_topomap(fbcsp.fbcsp_filters_multi[1][i]['u_mat'][0], x.info, axes = axs[1], show = True)

The second plot will not be shown as indicated by the screenshot below.

  • MNE-Python version: 0.22.0
  • operating system: Linux

You need to set show=False on all plot_topomap calls except for the last one, which can be True (or if you set it to False you can always call plt.show() after you’ve created all subplots).

It solve the problem, thanks Clemens.