Ask Your Question
0

load animation

asked 11 years ago

twch gravatar image

Hi, I have the following problem:

I'd like to present some calculations in a sage notebook. At one point I'd like to show an animation, but unfortunately it takes some time until the .show() command plots it. I also do not like to have the animation wiggling araound while I'm presenting the other things before. Hiding the output also doesn't help because I want that it really starts from the beginning on my click and not soemwhere in between.

Is there a possibility to load a saved gif animation? Otherwise is is still possible to open the animation in new window, but it would be neat to have the animation inside the notebook.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 11 years ago

ndomes gravatar image

Save the animation

frames = [... list of your frames ...]
M = animate(frames)
M.save(DATA+'movie.gif')

(Or upload the gif with the data menu)

Now you can use a html cell with an link to your gif.

%html
<a href="data/movie.gif">animation</a>
Preview: (hide)
link

Comments

Thanks! I also tried to create a link to the gif in my home folder but somehow I din't achiev this. Saving the gif in the DATA folder finnaly solves the problem.

twch gravatar imagetwch ( 11 years ago )

@ndomes: Super-cool! Can you find an appropriate place to add this to the documentation (perhaps in the animate module) to mention this as a great idea? I like the idea of using the html cell to keep it hidden.

kcrisman gravatar imagekcrisman ( 11 years ago )

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

Seen: 464 times

Last updated: Apr 17 '13