Copyright (c) 2013, Jake Vanderplas
See a rendered example: please note the browser requirements listedbelow.
Testing it Out
There are several scripts which demonstrate this.
creates a basic animation, with the frame data embedded within the HTML
document. Run this using
and then open the resulting file,
animation.html using your web browser.
This file is created using the option
embed = True, which means that the
image data is embedded directly in the html file in base64-representation.
This means that the animation is entirely self-contained in the file.
A more sophisticated animation can be created using
(adapted from this blog post
The resulting file,
can be opened in your web browser.
This animation is created using the option
embed = False, which means that
the frames are individually stored in the directory
This prevents the html file from being too large.
If you have IPython notebook installed, you can open
to see the automatic animation representation within the notebook. Simply
IPython_display submodule, create the animation, and the
Because the animation widget uses an HTML5 slider element, it does not work in some browsers. For a comprehensive list of supported browsers, see this list.