I am trying to combine matplotlib and vpython (the visual module) and
I am running into a threading issue (I think that is the issue). I am
basically trying to create a virtual demo for a feedback controls
course. I show an animation of a pendulum with different controls (P,
PD, PID, ...) and then after a few seconds of demo, the visual
animation loop calls a function that plots the step response of the
system with pylab. This all works great the first time, and after I
close the pylab window, the animation starts back up again as I think
it should. But I can't get additional plot windows to work correctly.
At first I just called show() at the end of the plot loop. When I
did that, the first time plotting worked correctly, the second time
did nothing and the third showed an empty plot (I manually closed the
plot window each time to resume the annimation thread). Later I added
a pylab.close('all') after pylab.show() as an attempt to clean up
after the window closing. Now the first plot is still good, but all
the rest don't seem to do anything.
Does anyone have any experience making vpython/visual play well with matplotlib?
I am using the TkAgg backend.