You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am having problems getting the code to function properly. If I run
it as is, the figure appears, but no animation is done. Apparently
the setup code is called, but the code to change the frames is not.
If I comment out the call to the setup code, the method to update
the frame is called once, and that is it.
The text was updated successfully, but these errors were encountered:
Did you try setting blit=False ? I had a problem where one of the subplots was static and the other was animating. Setting blit=False solved my problem.
The problem is related to #1656 . All of the timers and such for the animation are wrapped up in the FuncAnimation object. As your gist file is, you do not keep a ref to ani around so it gets garbage collected after __init__ opens.
Changing your __init__ to
class DataAnimator(object):
def __init__(self):
...
self.ani = animation.FuncAnimation(self.fig, self._update_frame, init_func=self._setup)
makes your gist behaves correctly.
Given how often this comes up, there should be something added to the documentation. Closing this in favor of #1656 .
I am trying to create a multi-subplot animation which is loosely based
on the animation example code, subplots.py, at
http://matplotlib.sourceforge.net/examples/animation/subplots.html
A simplified version of the full code is shown at this gist:
https://gist.github.com/3613113
I am having problems getting the code to function properly. If I run
it as is, the figure appears, but no animation is done. Apparently
the setup code is called, but the code to change the frames is not.
If I comment out the call to the setup code, the method to update
the frame is called once, and that is it.
The text was updated successfully, but these errors were encountered: