Sankey plots in Stata using Python

Sankey graphs in Stata

The sankey Stata package provides a simple way of producing Sankey graphs, using the plotly library in Python. You can find the plotly homepage here.

An example:

. use
. sankey start stop freq, colors(3 "green" 6 "red") linkcolor(lightgreen)

The produced plot can be viewed here.


sankey in Stata

The current version of sankey in Stata, which requires Stata version 16, can be installed by typing:

net install sankey, from(

and then run adoupdate as normal to pick up any updates.



comments powered by Disqus