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 Polar Density Plot in R
With cyclical data, a circular format might be useful. Combine that with a smooth density to reduce noise, and you got yourself a plot.
How to Make an Interactive Treemap
Treemaps are useful to view and explore hierarchical data. Interaction can help you look at the data in greater detail.
How to Make a US County Thematic Map Using Free Tools
There are about a million ways to make a choropleth map. The problem is that a lot of solutions require expensive software or have a high learning curve. It doesn’t have to be that way.