Matcher.py 文件源码

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

项目:AdK_analysis 作者: orbeckst 项目源码 文件源码
def barplot(self,direction,alpha=0.4):
        import pylab
        pnormalize = pylab.normalize(vmin=1,vmax=len(self.distribution[direction]))
        count = 0
        # dx = 0.1/(2*len(self.distribution[direction]))
        for target,(edges,heights) in self.distribution[direction].items():
            count += 1
            lefts = edges[:-1]                # + count*dx
            widths = (edges[1:] - edges[:-1]) # - count*dx
            RGB = pylab.cm.jet(pnormalize(count))[:3]
            pylab.bar(lefts,heights,width=widths,
                      alpha=alpha,
                      color=RGB,
                      label="%s" % target)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号