Category: General

Sankey Diagram using TikZ

Over at the TeX – LaTeX Stack Exchange (a Q&A site for users of TeX and LaTeX) this article explains “How to draw a Sankey Diagram using TikZ”. Okay, its a bit techie, but the results look good.

The original poster wanted to know how to draw a Sankey diagram using the TikZ package (TikZ is a “higher-level drawing language built on top of the PGF graphics framework”).

User Paul Gaborit came up with this example using TikZ and building his own sankeydiagram environment

The interesting thing is that flows can fork and join, and that there is a check that the sum of quantities must be equal to the quantity of sankey node to fork.

This is how the the original sample Sankey diagram looks like with this solution.

Very nice result. So for those out there used to working with TeX/LaTeX out this is actually a good solution.

Don’t miss to read the comments too (there’s one pointing to an alternative (Matplotlib and Sankey module).

U-turn Sankey arrows

This legacy article on ‘Solar Energy System and Design’ by W.B. Stine and R.W. Harrigan (published in 1985 already) has four Sankey diagrams for energy flows in a solar power system.

The old-school black&white Sankey diagrams depicted have a general vertical orientation, and some flows branch out to the left of the general flow direction. This is OK, but the first branch flow bends with an angle larger than 90° degrees, performing an almost U-turn.

In the next diagram this idea is doomed to fail as the Sankey arrow to the left is wider than the one going straight on, and the initial parallel segment is much too short.

Additionally in this second Sankey diagram the two arrows at the bottom don’t add up with their flow quantities correctly (633 kW + 244 kW is not 1008 kW).

New blog on MFA diagrams

A new blog dedicated to Material Flow Analysis (MFA) diagrams is available over at blogspot.

Material Flow Analysis (also refered to as Material Flow Accounting) is a research topic that focuses on specific substances or material flows on a macro level. Typically the system boundaries are a region or a country. Urban metabolism studies also use MFA diagrams. A key feature is the representation of stocks (storage or accumulation of material) within the system.

I have previously presented MFA diagram samples here on the blog that have Sankey diagram characteristics (i.e. arrow magnitudes proportional to flow quantities, directional arrows).

Here are two examples of MFA diagrams from the new blog for you to enjoy:


Platinum Flows in Europe. Source: Saurat, M., Bringezu, S., 2008. Platinum Group Metal Flows of Europe, Part 1 (via MFA diagram blog)


Phosphorus Flows. Source: Paul H. Brunner, 2007. MFA of regional lead flows and stocks [t/y] (via MFA diagram blog)

Make sure you visit the MFA diagram blog from time to time (I have put the link in the blogroll on the right), to see new interesting diagrams. I will also try to present some of them here…