为什么线在 Python 的 Sankey 图中穿过节点?

问题描述 投票:0回答:1

桑基线图穿过其中一个节点,但它应该像所有其他节点一样分开。知道为什么会发生这种情况或如何防止这种情况吗?

fig = go.Figure(data=[go.Sankey(

node = dict(

  pad = 100,
  thickness = 30,

  line = dict(color = "black", width = 2),
  label = [" Gas: 47 MW",
           " Stoom: 35 MW",
           " Elektriciteit: 12 MW",
           "Verlies: 1 MW ",
           
           "R: 17 MW ",
           "F: 14 MW ",
           "Fe: 8.5 MW ",
           "Ut: 4.5 MW ",
           "VN: 4.5 MW ",
           ],

link = dict(
  source = [0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2],
  target = [1, 2, 3, 4, 5, 6, 7, 4, 5, 6, 7, 8],
  value = [35, 12, 1, 13.8, 11.3, 7.3, 2.8, 3.4, 2.4, 1.1, 1.5, 3.6],)])

python plotly plotly-python sankey-diagram
1个回答
0
投票

我为链接设置了一些随机值,所以查看并更改它们 This is the code

© www.soinside.com 2019 - 2024. All rights reserved.