我试图使用plotly绘制树状图。我使用下面给出的代码:
import plotly.plotly as py
import plotly.figure_factory as ff
names = list(result_data['merchant_id'])
dendro = ff.create_dendrogram(new_data,labels=names)
dendro['layout'].update({'width':1400, 'height':600})
plotly.offline.iplot(dendro, filename='simple_dendrogram')
我如何在上图中分配标题,x标签和y标签?
答案 0 :(得分:0)
您只需使用所需设置更新布局,请参阅以下示例。
<强>代码:强>
import plotly.plotly as py
import plotly.figure_factory as ff
names = list(result_data['merchant_id'])
dendro = ff.create_dendrogram(new_data,labels=names)
dendro['layout'].update({'width':1400, 'height':600, 'title': 'this is the title',
'xaxis': {'title': 'xaxis label'}, 'yaxis': {'title': 'yaxis label'}})
plotly.offline.iplot(dendro, filename='simple_dendrogram')