Animated Graphs for data people

Let's get animated

This website is for people who do data analysis or statistics and want to make animated videos of their work. Because I use stop-frame animation, you are limited only by your imagination (and patience!), not by software. There are easier tools around, like gganimate in R, but they will limit your options. I use Stata and R here, but any software that lets you write a script/program to repeatedly make graphs and save them as picture files will do this. No fancy video editing or graphics software are involved!


0. First, install FFMPEG

1. Welcome  ←you are here

2. Line

3. Scatter

4. Phantom

5. Extended

Welcome!



These pages are aimed at data people: researchers, statisticians, economists, etc, who want to start producing animated video clips from their graphs and charts, using the software they are familiar with. All the advice, tips and examples in here are offered for free. Please browse through, copy and adapt any code that you find useful.

In the early 2010s, I saw some cool graphs made into videos like Hans Rosling's 200 Countries, 200 Years, which made me think "I want to do that!" I was pretty good at using statistical software, but I knew nothing about video editing / graphics software. I wanted a stats software solution, and I wanted it to be as flexible as possible.

How does it work?

It is actually quite simple to make an animated graph using stop-frame animation, the same technique used in the movies for many years before CGI was possible. Think of Ray Harryhausen or Wallace and Gromit.

Movies are simply made up of a series of images shown in rapid succession, and the viewer's brain interprets them as realistic motion. So, in the same way, we can create a stop frame animation using a sequence of graphs, each slightly different to the previous one. Thankfully, you don't have to spend months moving mannequins very slightly and taking the next photograph, over and over... all you need is a little programming in software like R or Stata, and it will do the hard work for you, making hundreds or even thousands of image files.

We then issue a one-line order to the free audio/video conversion software FFMPEG, and the image files will be combined into a video. As you'll see, the tricky bit is not converting them to video but rather thinking up the right sequence of graphs to achieve a particular visual effect.

Here's my version of Hans Rosling's video, made using only R. (I downloaded his data from Gapminder but decided only to draw from 1950 onward as the data are very patchy before that.) The code for this is in the Scatter page.