我正在尝试创建sankey图,但是无法填充节点(目标或源)标签。填充值(尽管格式笨拙)。我浏览了许多帖子都无济于事。我什至尝试仅拔出预期的标签并替换为填充物,但这也不起作用。任何帮助都将不胜感激...
import plotly as ply
import urllib
graph_data = dict (type='sankey',
domain = dict(
x = [0, 1],
y = [0, 1]),
orientation = 'h',
valueformat = '.0f',
node = dict(
pad = 10,
thickness = 30,
line = dict(
color = 'black',
width = 0),
#label = pd.concat([conf_client_table['item_x_group'], conf_client_table['item_y_group']], ignore_index=True))
label = ['20', '21', '22', '23', '24', '25']
),
link = dict(
source = conf_client_table['item_x_group'],
target = conf_client_table['item_y_group'],
value = conf_client_table['conf_score'],
label = conf_client_table['conf_score']
)
)
layout = dict(
title = 'test',
height = 400,
width = 600,
font = dict(
size=10
)
)
fig = dict(data=[graph_data], layout=layout)
ply.offline.plot(fig)