I have some python simulation code that runs for a minute or two and displays the output of the simulation in real-time.
I would like to show results on two different figure windows. Because I'm using an object oriented design, it's a little difficult to switch between the figures using the figure(x)
command, so I want to save a reference to each figure to each variable and use that to return to them. I've set it up like the following:
import pylab as p
f0 = p.figure()
f1 = p.figure()
ax0 = f0.add_subplot(111)
ax0.plot(range(0,50))
ax1 = f1.add_subplot(111)
ax1.plot(range(0,20))
ax1.text(0,1,"This is updatable",weight='bold',fontsize=16)
ax0.text(0,1,"This one, drawn first, is not.",weight='bold',fontsize=16)
p.pause(5)
The problem is that once I've created and accessed the second figure, the first figure is no longer accessible.
I am using matplotlib and running Python 2.7.6 using Pycharm CE with the MacOSX interactive backend.
Does anyone know how to set this up? Am I using the wrong graphing package for this kind of problem?
UPDATE: I found that if I closed the first window just using my mouse to access the on-window controls, then the second window would be updated. That doesn't solve my problem, though.