Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. import plotly.graph_objs as go
  2. from plotly.offline import plot
  3.  
  4. value = [3,5,2,4,6]
  5. source = [0,0,1,0,3]
  6. target = [1,4,2,3,4]
  7. color = ["blue","yellow","orange","orange","purple"]
  8. label = ["A","B","C1","C2","D"]
  9.  
  10.  
  11. data = dict(
  12. type='sankey',
  13. arrangement = 'freeform',
  14. node = dict(
  15. pad = 15,
  16. thickness = 20,
  17. line = dict(
  18. color = "black",
  19. width = 0.1
  20. ),
  21. groups = [[2,3]],
  22. label = label,
  23. color = color,
  24. ),
  25. link = dict(
  26. source = source,
  27. target = target,
  28. value = value,
  29. )
  30. )
  31.  
  32. layout = dict(
  33. title = "Sankey test",
  34. font = dict(
  35. size = 10
  36. )
  37. )
  38. f = go.FigureWidget(data=[data], layout=layout)
  39. plot(f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement