为什么go.Sankey()没有显示输出?(plotly.graph_输出,python)
我不熟悉Plotly,所以我希望这将是一个简单的答案…为什么go.Sankey()没有显示输出?(plotly.graph_输出,python),python,plotly,dashboard,Python,Plotly,Dashboard,我不熟悉Plotly,所以我希望这将是一个简单的答案… 我正在创建一个web应用程序仪表板,我希望我的一个子面板是Sankey。输出完全没有,只是空白。下面是我的代码中带有Sankey图表的部分: subfig.add_trace( go.Sankey( node=dict( pad=15, thickness=20, line=dict(color='black', width=0.5),
我正在创建一个web应用程序仪表板,我希望我的一个子面板是Sankey。输出完全没有,只是空白。下面是我的代码中带有Sankey图表的部分:
subfig.add_trace(
go.Sankey(
node=dict(
pad=15,
thickness=20,
line=dict(color='black', width=0.5),
label=testdf['Label'].tolist(),
color='blue'
),
link=dict(
source=testdf['Source'].tolist(),
target=testdf['Target'].tolist(),
value=testdf['Value'].tolist()
)
), row=3, col=1)
下面是我的web应用程序在“按条件类型和条件”下的外观:
我可以不使用go.Sankey()作为子批吗?我没有正确调用函数吗?求救
更新:gflavia建议我在子地块规范中添加类型,但我已经这样做了(尽管我可能做得不正确):
您可能需要在
make_subplot
的specs
属性中添加子地块类型,请参阅。感谢您的回复!我在原来的帖子上做了一个更新,向你展示了我在这方面做了些什么。你能提供一个更新吗?
rows=5, cols=4,
specs=[
[{}, {'colspan':2}, None, {}],
[{'colspan':4}, None, None, None],
[{'type':'sankey','rowspan':3, 'colspan':3}, None, None, {}],
[None, None, None, {}],
[None, None, None, {}]
],
subplot_titles=("By Age","By Percent of Ethnicity/Race Population", "By Sex", 'By State', 'By Condition Type and Condition', 'Compared to Other Viruses', 'By U.S. Region', 'By Place of Death' )
)