Is it possible to display a single figure multiple times in matplotlib?
I am looking for a solution that can roughly resemble the following:
fig1 = plt.figure()
fig2 = plt.figure()
ax1 = fig1.add_subplot(111)
ax2 = fig2.add_subplot(111)
ax1.imshow(a)
ax2.imshow(b)
fig1.show()
fig2.show()
fig1.show()
This seems to work in IDLE, figures stay active until closed and I can type in IDLE to open a new figure while the old one is still active. This does not work though when I run the script. Does this have anything to do with the interactive mode?
I also tried to pause the plot when running the script:
fig1.show()
plt.pause(10)
but this displays immediately both figures. Why is IDLE capable of displaying fig1.show() and waiting till it's closed, but while running the script fig1.show() closes immediately unless paused? And why does it display all the figures at the same time instead of just the one instance?