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, you must be a member. (If you are already a member, log in here.)
You will get unlimited access to step-by-step visualization courses and tutorials for insight and presentation — all while supporting an independent site. Files and data are included so that you can more easily apply what you learn in your own work.
Learn to make great charts that are beautiful and useful.
Members also receive 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 visualize data with cartoonish faces ala Chernoff
The goal of Chernoff faces is to show a bunch of variables at once via facial features like lips, eyes, and nose size. Most of the time there are better solutions, but the faces can be interesting to work with.
Transitioning Map, Part 3: Animate Change Over Time
How to make a bunch of maps and string them together to show change.
How to Display Text in R
Text can provide much needed context to traditional visual cues and can be used as a visual cue itself in some cases.