New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FuncAnimation.save() only saving 1 frame #5822
Comments
This is a duplicate of #5399 will be fixed in 1.5.1 |
As a work around you can supply it with an empty init function |
Wow, fast response, thanks! Just tested, and this works. |
Hello! I am having the exact same problem, but when I attempted to supply it with an empty init function, it gave me an error. I am new to this, and perhaps interpreted it wrong. Anyways, would love any suggestions... My code is below. The animation on its own works fine, however it is only saving the first frame.
|
@wendycrumrine Which version are you using This has been fixed in 1.5.1 so the easies solution is to upgrade to 1.5.1 if you can upgrade |
#Import Tools #Create 2D meshgrid in Cartesian Space yL = 2*np.pi X,Y = np.complex_(np.meshgrid(xVEC,yVEC)) #Create 2D meshgrid in Fourier Space deltaK_y = (2_np.pi)/yL yK,xK = np.complex_(np.meshgrid(yKvec,xKvec)) #Construct K2 #Discretize Time #Initialize two circular vorticies ##Compute all initial terms of PDE vORTstore = np.complex_(np.zeros((len(xVEC),len(yVEC),len(tVEC)))) #Integrate vorticity through time #Animate Writer = animation.writers['ffmpeg'] def data(i,vORTmovie,line): fig = plt.figure() ani = animation.FuncAnimation(fig, data,np.arange(1,len(vORTmovie[0,0,:])), fargs=(vORTmovie, line), interval=1) plt.show() |
Thanks for the speedy reply! I'm not sure which version I'm using, ugh! I am using Spyder 2.3.8, Python 3.5.1 64bits, Qt 4.8.7, PyQt4 (API v2) 4.11.4 on Darwin. I am assuming I am using an old version, and will attempt to upgrade through Anaconda now. :) |
You can get the version from something like
|
Thank you! --wendy On Wed, Jun 1, 2016 at 9:29 AM, Jens Hedegaard Nielsen <
|
Summary: matplotlib 1.5 only saving 1 frame of animation, 1.4.3 saves all frames
I have code that reads like this (link to full code below):
This has always worked for me until I reran it a few days ago. Now only saves the first frame of the animations. I put prints in the bar_animate function, and it is being called 100 times. I stepped into the save routine: it builds a list generator - when I expand it out it contains only (1,), so only one frame gets saved. I didn't dig deep enough to figure out why that tuple was generated.
My environment is Anaconda 64-bit, Windows 7, Python 3.5.1, IPython 4.0.1, matplotlib 1.5.
If I downgrade matplotlib to 1.4.3 then the save works - all 100 frames are saved to the gif. If I then upgrade, only 1 frame is saved. I did this cycle a couple of times to verify that this is the only difference. The directories for both have a valid matplotlibrc as far as I can tell - I edited them to use imagemagick, and put the full path to imagemagick in, as required for windows.
The code that evokes this behavior lives here:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python/blob/master/animations/discrete_bayes_animations.ipynb
I'm a programmer, so if you can't reproduce this and need help tracking the bug down let me know.
The text was updated successfully, but these errors were encountered: