# Subplots are not shown in interactive plot

**URL:** <https://mne.discourse.group/t/subplots-are-not-shown-in-interactive-plot/7609>\
**Category:** Support & Discussions\
**Tags:** visualization\
**Created:** [October 4, 2023, 8:01pm UTC](https://mne.discourse.group/t/subplots-are-not-shown-in-interactive-plot/7609 "2023-10-04T20:01:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nafraw](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/nafraw/32/3071_2.png) [@nafraw](https://mne.discourse.group/u/nafraw)\
**Post date:** [October 4, 2023, 8:01pm UTC](https://mne.discourse.group/t/subplots-are-not-shown-in-interactive-plot/7609/1 "2023-10-04T20:01:49Z")

</div>

Hello everyone,

I am using VS Code to plot topomaps on Jupyter interactive window and encountered an issue. Minimal reproduceable codes are provided at the end to replicate the issue and images.

I found that providing subplot axes does not work. It only shows the first topomap as the image below.

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/7/7580f5620312c3c7f66124ed9a0e221e09193aba.png)

However, if I type “fig” at the end, it shows all the topomaps as below.

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/0/0f83f5f8273d2964c882ccbb36f4812d0166f2c3.jpeg)

I used plot() on random data to see if something is wrong with my environment setting, and it seems working fine as all subplots are properly done as below.

 ![image](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/0/0b1724861fd98ff3591e7d364d5966383358f38b.png)

I also found that if I run the codes using terminal, there will be a total of three figures (a new one pops out after closing the old figure) for the topomap part, If I use fig.show(), it does not show the correct plot but the figure with one topomap and two empty subplots.

Does anyone know whether it is a problem of my syntax, developing environment, or the MNE library, and how to fix it?

```python
import mne
import matplotlib.pyplot as plt
import numpy as np

mnt = mne.channels.make_standard_montage("biosemi64")
info = mne.create_info(ch_names=mnt.ch_names, sfreq=250, ch_types='eeg')
info.set_montage(mnt)

nCol = 3
fig, ax = plt.subplots(nrows=1, ncols=nCol, figsize=(20, 5))
for i in range(0, nCol):
    fake_data = np.random.rand(len(mnt.ch_names))
    mne.viz.plot_topomap(fake_data, info, axes=ax[i])

fig2, ax2 = plt.subplots(nrows=1, ncols=nCol, figsize=(20, 5))
for i in range(0, nCol):
    fake_data = np.random.rand(len(mnt.ch_names))
    ax2[i].plot(fake_data)

fig

```

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [October 5, 2023, 4:57am UTC](https://mne.discourse.group/t/subplots-are-not-shown-in-interactive-plot/7609/2 "2023-10-05T04:57:11Z")

</div>

look at the show parameter in mne.viz.plot\_topomap

my default mne calls plt.show() that outside jupyter opens a separate window.

if you use show=False in mne.viz.plot\_topomap and then only do plt.show()  
I guess it should work

Alex
