In [1]:
name = '2016-10-21-data-animations-intro'
title = 'Introduction to data animations'
tags = 'matplotlib, animation'
author = 'Matthew Bone'
In [2]:
from nb_tools import connect_notebook_to_post
from IPython.core.display import HTML, Image
html = connect_notebook_to_post(name, title, tags, author)
Today we discussed the basics of 2D data animation in matplotlib.
We mostly jsut went through the examples available in the matplotlib.animation
's gallery and API documentation.
A very good introduction to animation basics is provided in Jake Vanderplas's blog, Pythonic Perambulations
In the second half of the session we looked at MoviePy - a very cool Python library designed for video editing. It can be used for basic operations (like cuts, concatenations, title insertions), video compositing, video processing, or to create advanced effects. It can read and write the most common video formats, including GIF.
It is a generic video editing module, but can be easily plugged in to your script to write out matplotlib animations. As a nice bonus, the resulting video files are of better quality and much lighter. MoviePy is also about twice as faster than matplotlib. For more information on this issue, look here.
On how to use MoviePy for data animations, see this awesome blog post: Data Animations With Python and MoviePy.
In [3]:
HTML(html)
Out[3]: