Ask Your Question
0

Animation example from matplotlib.org does not work.

asked 2013-01-17 06:10:25 -0500

dxvxd gravatar image

I'm trying to run thisexample from matplotlib.org. I downloaded the source code and ran:

sage: load('animate_decay.py')

sage: plt.savefig('foo.png')

The file, foo.png, contained an empty Cartesian plane. I also typed in the code verbatim into the Sage interpreter and had the same results. I am running Sage Version 5.5, Release Date: 2012-12-22 on Ubuntu 12.04.1 LTS. Any suggestions would be greatly appreciated!

edit retag flag offensive close merge delete

Comments

I'm not sure the png format can handle animations. Perhaps look at the matplotlib manual ( http://x0.no/a9a7 ) to try to export to a format which can handle the animation? It seems `ani` is the variable in which the animation is stored. Sage provides its own animation interface, for some nice examples see: http://x0.no/a9aa

fidbc gravatar imagefidbc ( 2013-01-17 11:39:24 -0500 )edit

There is apng but I don't know if matplotlib can write apng. Also, not all browsers can display apng files.

ppurka gravatar imageppurka ( 2013-01-17 12:55:25 -0500 )edit

Sage's matplotlib version is old. Perhaps this might be the reason that this doesn't work.

Dima gravatar imageDima ( 2013-01-17 17:10:38 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-01-19 09:51:19 -0500

I posted this answer in sage-support, but for completeness, I'll post it here as well. The following works for me:

sage: from animate_decay import *
sage: ani.save('blah.mp4')
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-01-17 06:10:25 -0500

Seen: 470 times

Last updated: Jan 19 '13