Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import plotly.graph_objs as go
- from plotly.offline import plot
- value = [3,5,2,4,6]
- source = [0,0,1,0,3]
- target = [1,4,2,3,4]
- color = ["blue","yellow","orange","orange","purple"]
- label = ["A","B","C1","C2","D"]
- data = dict(
- type='sankey',
- arrangement = 'freeform',
- node = dict(
- pad = 15,
- thickness = 20,
- line = dict(
- color = "black",
- width = 0.1
- ),
- groups = [[2,3]],
- label = label,
- color = color,
- ),
- link = dict(
- source = source,
- target = target,
- value = value,
- )
- )
- layout = dict(
- title = "Sankey test",
- font = dict(
- size = 10
- )
- )
- f = go.FigureWidget(data=[data], layout=layout)
- plot(f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement