Code to create matplotlib animations, capable of being embedded into html files or into a jupyter notebook
This code is a modification of the animation presented by Louis Tiao http://louistiao.me/posts/notebooks/embedding-matplotlib-animations-in-jupyter-notebooks/
To view the results, download the .html file and open it in the browser.