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)
评论列表
文章目录