Embedding Matplotlib Animations in Jupyter Notebooks

UPDATE (March 2018): For a more modern solution that uses an interactive JavaScript widget, please go to my new post: Embedding Matplotlib Animations in Jupyter as Interactive JavaScript Widgets. In