第一步:申请密钥
https://plot.ly/#/ 注册一个账号,第一次需要生成密钥
第二步:
import pandas as pd import chart_studio.plotly as py import plotly.figure_factory as ff import numpy as np data = pd.read_csv('E:\result.csv',nrows =500,encoding='gbk') X = data[["类别"]] fig = ff.create_dendrogram(X, orientation='left',labels=list(data["名称"])) fig['layout'].update({'width':800, 'height':1500}) py.plot(fig, filename='dendrogram_with_labels')
运行结果:
这个图的看法:从右往左依次画竖线分成多个部分