clustering.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:ccCluster 作者: gsantoni 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号