Matcher.py 文件源码

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

项目:AdK_analysis 作者: orbeckst 项目源码 文件源码
def plot(self,direction,legend=True,**kwargs):
        """Plot all distributions; colors are set automatically to kwargs[cmap]."""
        import pylab
        pnormalize = pylab.normalize(vmin=1,vmax=len(self.distribution[direction]))

        kwargs.setdefault('alpha',1.0)
        kwargs.setdefault('linewidth',4)
        fmt = kwargs.pop('fmt','-')
        cmap = kwargs.pop('cmap',pylab.cm.jet)

        count = 0
        for target,(hist,edges) in self.distribution[direction].items():
            count += 1
            midpoints = 0.5*(edges[1:] + edges[:-1])
            kwargs['color'] = cmap(pnormalize(count))
            pylab.plot(midpoints,hist,fmt,label="%s" % target,**kwargs)
        if legend:
            pylab.legend(loc='best',
                         prop=pylab.matplotlib.font_manager.FontProperties(size=6))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号