I am using python and want to draw a graph includes 5 images, which looks like this:
Here is my codes:
fig, axes = plt.subplots(nrows=1, ncols=5, figsize=(50, 5))
ax = axes[0]
ax.title.set_text('1')
im,_ = mne.viz.topomap.plot_topomap(data_fft[0],l.pos,show_names=True,names=locs,axes=ax,cmap='Spectral_r',show=False)
ax = axes[1]
ax.title.set_text('2')
im,_ = mne.viz.topomap.plot_topomap(data_fft[1],l.pos,show_names=True,names=locs,axes=ax,cmap='Spectral_r',show=False)
ax = axes[2]
ax.title.set_text('3')
im,_ = mne.viz.topomap.plot_topomap(data_fft[2],l.pos,show_names=True,names=locs,axes=ax,cmap='Spectral_r',show=False)
ax = axes[3]
ax.title.set_text('4')
im,_ = mne.viz.topomap.plot_topomap(data_fft[3],l.pos,show_names=True,names=locs,axes=ax,cmap='Spectral_r',show=False)
ax = axes[4]
ax.title.set_text('5')
im,_ = mne.viz.topomap.plot_topomap(data_fft[4],l.pos,show_names=True,names=locs,axes=ax,cmap='Spectral_r',show=True)
How to add a colorbar under this graph?
I have tried fig.colorbar(im, ax=axes, orientation='vertical')
, but the error: AttributeError: 'numpy.ndarray' object has no attribute 'get_figure'