Ask Your Question
0

Animation example from matplotlib.org does not work.

asked 2013-01-17 13:10:25 +0200

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 18:39:24 +0200 )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 19:55:25 +0200 )edit

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

Dima gravatar imageDima ( 2013-01-18 00:10:38 +0200 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-01-19 16:51:19 +0200

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 13:10:25 +0200

Seen: 637 times

Last updated: Jan 19 '13