I was asked what the largest Sankey diagram I have seen so far was? Not sure about this. The Swiss biomass flows diagram I featured in January 2009 would be a candidate, but I think the following one is much larger, both in the actual diagram size, as well as in respect to the number of nodes and arrows.

It was created by the marketing department of RWE AG, one of Germany’s big four electricity providers. It shows the energy flows in Germany for 1995. The image file I have is 2588 x 1062 pixels, so when you click on the image below, you won’t be seeing the full image, but only a thumbnail… (also because I don’t want to get sued by their legal department!)

Energy flows Sankey diagram for Germany 1995. Produced by RWE Energie

The clear structuring of the diagram is what might be called “very German”: energy sources are at the left, with non-renewables at the top and renewables at the bottom. The second section shows energy conversion, the third section the energy use sectors. These are further broken down, before the arrow join again to show useful energy and energy losses (a 50:50 relationship). Losses in the conversion phase are shown as arrows that branch out vertically to the bottom. Exports and bunkering, on the other hands, is shown as vertical flow leaving to the top. Color coding is very clear, and flows are labeled with figures on each arrow. The unit is petajoule (PJ)

Even the black background goes well with the bright colours. Here are two close-ups of two sections from this energy flow diagram. Enjoy the beauty…

Section from energy flows Sankey diagram for Germany 1995. Produced by RWE EnergieSection from energy flows Sankey diagram for Germany 1995. Produced by RWE Energie

I am always getting excited when I have a new e-mail with a Google alert for Sankey diagrams. This time I was directed to this blog post.

SankeyR is a function for the R open source statistical computing and graphics package based on the drawSankey routine for Matlab developed at EPFL. Aaron Berdanier at Colorado State adapted it to work with R. It produces simple left-to-right Sankey diagrams like this one:

Sample diagram produced with SankeyR by Aaron Benadier at Colorado State University.

The routine creates a plot in R, or can be outputed to bmp or pdf format. “Inputs do not need to equal losses. Any difference will be displayed as a discrepancy in the height of the left and right sides of the diagram. This capability enables the developer to examine imbalances in flows.”

Get the source from Aaron’s blog.

I have added SankeyR to the Sankey software list. Thanks Aaron for sharing this with the R community. I am just not sure how what to make of the blog name…

Following up to my last post after the knockout of the 2010 FIFA world cup. Well, things have cooled down a bit now, so here is the completed Sankey diagram showing the tournaments goals.

2010 FIFA worldcup goals Sankey  diagram by PHineas sankey-diagrams.com

As one commenter put it, you can “see that Spain’s road to success is a rather boring one (a thin line of 1:0 wins) while Germany was pretty inefficient (big lines, no gain).”

Drawing this was fun, although I was not happy to see my favourite team drop out in the quarter finals already…

In doing the Sankey diagram I found it difficult to handle null flows (that is, explicit zeros, not “no value”) in a Sankey diagram. Also I am not happy with the differentiation of regular goals and penalty goals (brown Sankey arrows). Maybe I’ll come up with a different presentation in time before the 2014 worldcup in Brazil…. ;-)

Blog reader Johan Land submitted the Sankey diagram below. “As I am interested in the energy field I especially was fascinated by the LLNL graph over US energy consumption. I spent the weekend on further enhancing the LLNL graph using a trial version of e!Sankey (and data that I have gathered the last few years). I’m attaching the PNG-file for this graph. Feel free to share it if you like the graph!”

Sankey diagram for U.S. energy consumption, created by Johan Land. Diagram uses original LLNL energy flow diagram, but adds the red and the pink sections with additional information.

(click image to enlarge)

The typical LLNL graph has been extended by the red section on the left that shows a world energy breakdown. Only the U.S. energy consumption is traced further.
The second extension is the pink section. Here, Johan has broken down the energy use sectors ‘Residential’, ‘Commercial’, ‘Industrial’ and ‘Transportation’ in one or two further steps.

All flows are in TWh, data is from 2005 to 2009. The author used several additional data sources and recompiled the data, so that “figures may differ from Lawrence Livermore Laboratory estimations”. See notes for further information.

Good Sankey diagram, and definitely a great job Johan did here. The only suggestion I have, is to add percentage figures to the regional energy breakdown (red section on the left). Unfortunately, the watermark spoils the overall impression, but this is owed to the fact that he used a free trial version.

Johan also mentioned that he is working on forecasts up to 2050, and an animated GIF “running it over time since 1950 up until 2008″. Hope to be able to show you these here on the blog someday.

Inspired by the diagram on the knockout stage of the 2010 FIFA worldcup, I just had the idea to “sankeyfy” it. The width of the Sankey arrow represents the number of goals scored. Penalty goals are shown in different color (brown), but to scale.

Sankeyfied 2010 FIFA worldcup knockout stage diagram by PHineas sankey-diagrams.com

Now I have to run for the Brazil-Netherlands match….
Will update this diagram after the quarter-finals…

I have been presenting “bad examples” of Sankey diagram before (like this one, or this one), and I have a few more in my collection.
The following one from an PowerPoint presentation by someone from PennState. The topic of the presentation is actually quite interesting: thermoacoustic refrigeration – using sound waves for cooling. It describes the results of a research project.

Sankey diagram from

Unfortunately, this Sankey diagram has some shortfalls, which qualify it as being a “bad example”. These are:

  • Sankey arrow widths are not always to scale (see for example the flow of 7.6 W in the middle labelled “surface”, which is definitely not half the width of the 14.6 W flow marked “Joule loss”)
  • Arrows branching out of the main flow are shown as short stubs, just as if the quantity is represented by the length (!) of the arrow, rather than its width. A completely new concept for Sankey diagrams. Have a look at the 0.9 W mini-stub “Surface” in the cone area, and at the 1.2 W stub “Surface” in the linear motor box.
  • The diagram uses dotted-dashed frames to mark sections in the diagram, at the same time it uses white arrows with a simple border line for the Sankey arrows. Either colored or grey areas, or colored Sankey arrows would have helped enormously.
  • Arrows branch off orthogonally, and to accomadate for the reduced quantity in the remaining flow, the border of the arrow on the opposite side curves in. This is not wrong as such, but rather uncommon, and can best be observed in the linear motor section at the left. Same phenomenon for arrows joining the main arrow. The arrow heads just overlap rather than actually joining the other arrow graphically. The receiveing arrow bulges out on the other side.
  • The section between the exhaust heat exchanger and the regenerator is awkward, and probably wrong. How can you branch off 296.6 W and 5.8 from a stream of 320.5 W, and are still able to have a flow of 63.0 W lead away from the remaining flow. I have not yet figured out what the problem is, but possibly the “Carnot minimum” flow was supposed to be drawn the other way round.

When I get to figure out the last issue I might draw this Sankey diagram myself, and post it here.

Does it take a hero like Daniel Ferry from the Excelhero blog to do a Sankey diagram in Excel? Well, you may not have to be a hero, but as Daniel puts it, this is “… seriously tedious work, as Excel has no native chart type to do what is required automatically.”

Daniel used the LLNL 2008 U.S. energy flow charts as model for his Sankey diagrams in Excel. Here is what he came up with (clipped section):

Section from an energy flow diagram (Sankey diagram) created by Daniel Ferry @ExcelHero blog (http://www.excelhero.com/blog/2010/03/energy-flow-chart.html)

Actually the result is quite close to the original Sankey diagrams, with similar colours, arrow routing, and even the same fonts.

Daniel explains:

“I lightened the colors on the input boxes (had to do it), but otherwise I think my rendition is faithful to the original. I may have stayed too true to flow pipe proportionality. Some of them are so thin they do not print well. This should be addressed. While my pipes are seemingly lined up, they will not survive the chart being resized vertically without some small errors, either gaps in a pipe stack, or overlap.
(…)
An interesting project would be to create an Excel addin that would allow you to specify category box locations and have VBA do all of the grunt work in lining up the flow pipes, automatically creating the chart. (…) In it’s current form no VBA was used. “

So, if you wish to draw a Sankey diagram with the Microsoft Office package installed on your computer, and enjoy using VBA, you might want to give it a shot. Gabor Doka’s Sankey helper (an Excel macro) is another option. Dedicated Sankey diagram software tools are available. It would recommend one of those, if you need to produce more than one Sankey diagram, or wish to make updates to your diagram and layout adaptations more comfortably.

BTW, here is the story on the man behind the Sankey diagrams at LLNL.

I recently discovered Trefis and their Sankey-style diagrams as a visualization. Trefis models are used to determine the target stock price for companies, by looking at their product portfolios and playing around with the expected growth rates and market shares. Well, there is a whole model behind these interactive graphics, but the interesting part is that the share of the companies turnover is broken down by products, and is shown with proportional Sankey-like arrow magnitudes.

At the tip of the joint arrow head you can see the target share price, which is calculated as “the result of mathematically combining all of our forecasts for a company into a single number representing the per share value of the company.” When playing around with the parameters, this value will adapt accordingly.

Here are some examples

Sample image fron www.trefis.com © 2010 Insight Guru, Inc.Sample image fron www.trefis.com © 2010 Insight Guru, Inc.Sample image fron www.trefis.com © 2010 Insight Guru, Inc.

Forbes, techCrunch and the New York Times all reported about what the latter calls “America’s Next Top Stock Model”, but none of the mentioned Sankey diagrams though.

Have fun playing around with the models … they have fancy Web2.0-silverlightish animations too. But don’t blame me if the share doesn’t reach the forecasted price ;)