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 Make a Multi-line Step Chart in R
For the times your data represents immediate changes in value.
How to Make Dot Density Maps in R
Choropleth maps are useful to show values for areas on a map, but they can be limited. In contrast, dot density maps are sometimes better for showing distributions within regions.
Small Multiples in R
Make a lot of charts at once, line them up in a grid, and you can make quick comparisons across several categories.