Tutorials  /  ,

How to Make a Sankey Diagram to Show Flow

These tend to be made ad hoc and are usually pieced together manually, which takes a lot of time. Here’s a way to lay the framework in R, so you don’t have to do all the work yourself.

To access this full tutorial and download the source code you must be a member. (If you are already a member, log in here.)

Membership

Gain instant access to 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.

Members also recieve a weekly newsletter, The Process, which looks more closely at the tools, the rules, and the guidelines and how they work in practice.

See samples of everything you gain access to:

About the Author

Nathan Yau is a statistician who works primarily with visualization. He earned his PhD in statistics from UCLA, is the author of two best-selling books — Data Points and Visualize This — and runs FlowingData. Introvert. Likes food. Likes beer.

More Tutorials See All →

More on Making Heat Maps in R

You saw how to make basic heat maps a while back, but you might want more flexibility for a specific data set. Once you understand the components of a heat map, the rest is straightforward.

Loading Data and Basic Formatting in R

It might not be sexy, but you have to load your data and get it in the right format before you can visualize it. Here are the basics, which might be all you need.

Bivariate Area Charts in R

Quickly compare two time series variables with this line-area chart hybrid that originated in the 1700s.

How I Made That: Animated Square Pie Chart

Also known as waffle charts. Using animated transitions between values, you can allow for comparisons between categories.