This website is 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. I would love to hear from you if you found animatedgraphs.co.uk useful, and if you devise any new tricks, please share them with me and I will credit you on the website.

I have seen some cool graphs made into videos like Hans Rosling's 200 Countries, 200 Years, which made me think "I want to do that!" Now, I analyse data all day long, and I am (if I say so myself) pretty good at using software like Stata or R, but I know nothing about video editing / graphics software, and in fact... I don't want to.

I don't have the time or the energy to learn new software, and I don't have the money to hire a graphic design / video expert (like the ones lurking in Hans's video). I want to make animations from inside my data analysis software. I want the process to be simple but flexible so I am not restricted in the look of my animations and the effects I can build into them.

If you feel the same way, then I think the process I describe on this website will interest you.

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's Jason and the Argonauts 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 heavy lifting 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 (click here for more details), and the image files will be combined into a video. Follow the links at the top of the page to see all my examples and access the code. As you'll see, the tricky bit is not converting them to video but rather getting 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 in on the Scatter page.