First time here? Check out the FAQ!

Ask Your Question
0

Animation example from matplotlib.org does not work.

asked 12 years ago

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!

Preview: (hide)

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 ( 12 years ago )

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

ppurka gravatar imageppurka ( 12 years ago )

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

Dima gravatar imageDima ( 12 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

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')
Preview: (hide)
link

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: 12 years ago

Seen: 725 times

Last updated: Jan 19 '13