How to Make Stacked Area Charts in R
From the basic area chart, to the stacked version, to the streamgraph, the geometry is similar. Once you know how to do one, you can do them all.
Back in 2008, The New York Times, with the help of Lee Byron, published a streamgraph that showed the ebb and flow of box office receipts. The graphic was based on Byron’s previous work with last.fm listening habits, and it was well-received by many, while others argued that it was not as accurate as it could be. Byron, along with Martin Wattenberg, later argued in their paper that while some accuracy is sacrificed, the balance of aesthetics and traditional chart-making make for a worthwhile chart.
In this tutorial you learn what goes into the streamgraph and end up with a simple function that you can easily use with other datasets.
To access this full tutorial and download the source code you must be a member. (If you are already a member, log in here.)
Get instant access to this tutorial and over a hundred more, plus courses, guides, and additional resources.
You'll get unlimited access to hundreds of hours worth of step-by-step visualization courses and tutorials for insight and presentation — all while supporting an independent site. Source code and data is included so that you can more easily apply what you learn in your own work.
The tutorials are very helpful to move from "Oooo, cool!" to how to actually DO the cool.
Members also recieve a weekly newsletter, The Process. Keep up-to-date on visualization tools, the rules, and the guidelines and how they all work together in practice.
See samples of everything you gain access to:
More Tutorials See All →
How to Draw Maps with Hatching Lines in R
Fill areas with varying line density to give more or less visual attention. With geographic maps, the technique is especially useful to adjust for population density.
How to Make a Mosaic Plot in R
Also known as a Marimekko diagram, the mosaic plot lets you compare multiple qualitative variables at once. They can be useful, sometimes.