Ask Your Question

Animation example from does not work.

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

dxvxd gravatar image

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

sage: load('')

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


I'm not sure the png format can handle animations. Perhaps look at the matplotlib manual ( ) 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:

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

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 *
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


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

Seen: 464 times

Last updated: Jan 19 '13