Energy sankey

Download this notebook from GitHub (right-click to download).


In [1]:
import pandas as pd
import holoviews as hv

hv.extension('matplotlib')
hv.output(fig='svg')

Declare data

In [2]:
edges = pd.read_csv('../../../assets/energy.csv')
edges.head(5)
Out[2]:
source target value
0 Agricultural 'waste' Bio-conversion 124.729
1 Bio-conversion Liquid 0.597
2 Bio-conversion Losses 26.862
3 Bio-conversion Solid 280.322
4 Bio-conversion Gas 81.144

Plot

In [3]:
hv.Sankey(edges, label='Energy Diagram').opts(
    label_position='left', edge_color='target', node_color='index', cmap='tab20')
Out[3]:

Download this notebook from GitHub (right-click to download).