eud*_*xos 12 matplotlib histogram
我正在创建直方图
pylab.hist(data,weights,histtype='step',normed=False,bins=150,cumulative=True)
Run Code Online (Sandbox Code Playgroud)
得到(还有其他的情节,现在是无关紧要的)紫罗兰色的线条
为什么直方图再次降到零?累积函数通常应该是非递减的.有没有办法解决这个问题,无论是错误还是功能?
编辑:解决方案(黑客):
# histtype=step returns a single patch, open polygon
n,bins,patches=pylab.hist(data,weights,histtype='step',cumulative=True)
# just delete the last point
patches[0].set_xy(patches[0].get_xy()[:-1])
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1997 次 |
最近记录: |