概述
为什么当代码通过python运行时,图形似乎在y轴上以10 ^ -1分解?(下面的代码)
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图片?
输出与python 2.7和matplotlib 1.4.2(debian / jessie)不同,但不是python 2.7和matplotlib 1.3.1(xubuntu 14.04 / trusty).
可以使用matplotlib的版本进行检查
python -c 'import matplotlib; print(matplotlib.__version__)'
总结
以上是编程之家为你收集整理的python – matplotlib stepfilled直方图在xubuntu上的值为10 ^ -1全部内容,希望文章能够帮你解决python – matplotlib stepfilled直方图在xubuntu上的值为10 ^ -1所遇到的程序开发问题。
如果您也喜欢它,动动您的小指点个赞吧