为什么当通过python运行代码时,图表在y轴上似乎分解为10^-1?(代码如下)matplotlib在xubuntu上的值为10^-1的stepfilled直方图中断
from pylab import *
bins = [+0.000e+00,+1.000e+00,+2.000e+00,+3.000e+00,+4.000e+00,+5.000e+00]
wght = [[+3.000e-02,+7.0e-02,+3.0e-01,+5.0e-01,+8.0e-01]]
hist([ bins[:-1] for i in range(len(wght)) ], bins=bins, weights=wght,histtype="stepfilled", log=True)
ylim(bottom=0.01); ylim(top=1.0)
savefig("./output.pdf")
这实际是这样的:
我目前在Xubuntu 14.04上运行python 2.7,并且这个错误发生在很多直方图上。出于某种原因,当我们在Windows上打开并运行Python(x,y)时,我们得到了第一个直方图(它看起来应该是什么样子),但是当我转移到Xubuntu上的python时,我试图运行类似于这个图的所有图都有问题在y轴上的10^-1处(它实际上是什么样子)我可以用这段代码做些什么来确保它在我想运行的任何python版本上输出第一张gyazo图片?
要检查的输出是与蟒2.7除外和matplotlib 1.4.2,但不与Python 2.7和matplotlib 1.3.1(Xubuntu的14.04 /可信任)。 Windows上的matplotlib版本是什么? –
这是一个以前的问题,https://github.com/matplotlib/matplotlib/issues/196 –
可能的重复http://stackoverflow.com/questions/13583443/matplotlib-stepfilled-hist-in-y- log-scale-dont-show-correctly –