def plotTree( self, pos=None):
P = hierarchy.dendrogram(self.Tree, color_threshold=0.3)
icoord = scipy.array( P['icoord'] )
dcoord = scipy.array( P['dcoord'] )
color_list = scipy.array( P['color_list'] )
xmin, xmax = icoord.min(), icoord.max()
ymin, ymax = dcoord.min(), dcoord.max()
if pos:
icoord = icoord[pos]
ioord = dcoord[pos]
color_list = color_list[pos]
for xs, ys, color in zip(icoord, dcoord, color_list):
plt.plot(xs, ys, color)
plt.xlim( xmin-10, xmax + 0.1*abs(xmax) )
plt.ylim( ymin, ymax + 0.1*abs(ymax) )
plt.show()
评论列表
文章目录