File Exchange

image thumbnail


version 1.1 (4.04 KB) by

drawSankey is a MatLab function that draws single-direction Sankey diagrams



View License

drawSankey is a matlab function that draws single-direction Sankey diagrams (i.e no feedback loops), however, multiple inputs can be specified.The syntax is the following:

drawSankey(inputs, losses, unit, labels, sep)

inputs: a vector containing the flow inputs, the first of which will be considered the main input and drawn centrally, other inputs will be shown below this.

losses: a vector containing all of the losses from the system, which will be displayed along the top of the Sankey diagram

unit: a string indicating the unit in which the flows are expressed

labels: a cell list of the labels for the different flows, starting with the labels for the inputs, then the losses and finally the output

sep: an (optional) list of position for separating lines, placed after the loss corresponding to the indexes provided

Current Version: 02.11.2009
Developed by: James SPELLING, KTH-EGI-EKV

Distributed under Creative Commons Attribution-NonCommerical-Share Alike (by-nc-sa) Licensees may copy, distribute, display, and perform the work and make derivative works based on it only for noncommercial purposes. Credit must be given to the developer when using, distributing or modifying this work and derivative works must be distributed under identical license conditions

Comments and Ratings (4)


Willem (view profile)

The only tool I can find to draw a Sankey diagram directly in Matlab. Only problem is that big arrows will not fit in the pop-up window. But when opening in plot tools it is posible to make it fit.


Aditya (view profile)

I think this is very interesting. I need to use it more before I can give it a rating.

A question for you regarding the license. I would like to use it to prepare some plots in the company I work for but I am not sure based on the wording of the license:
" Distributed under Creative Commons Attribution + NonCommerical (by-nc)
Licensees may copy, distribute, display, and perform the work and make derivative works based on it only for noncommercial purposes".

Does that mean I can't use it in my job?

If so would you consider changing the license so that someone can use it for any purpose?

Thank you.

Alec de Zegher

Alec de Zegher (view profile)

  • 1 file
  • 4.77778

Very good tool.
Simple to use & generates good sankey diagrams. However customization options are limited.




Modification of function description

MATLAB Release
MATLAB 7.7 (R2008b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video