小编Keb*_*hun的帖子

matplotlib stepfilled直方图在xubuntu上的值10 ^ -1处中断

为什么当代码通过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")
Run Code Online (Sandbox Code Playgroud)

应该是什么样的: 正确的图像步进超过10** -  1

它实际上是什么样的:

输出破损

我目前在Xubuntu 14.04上运行python 2.7,这个错误发生在很多直方图上.出于某种原因,当在Windows上打开并运行Python(x,y)时,我们得到第一个直方图(它应该是什么样子)但是当我在Xubuntu上移动到python时,我尝试运行的所有图形都与此类似在y轴上的10 ^ -1.(它实际上是什么样的)我可以用这个代码做什么来确保它在我想要运行的任何python版本上输出第一个gyazo图片?

python matplotlib python-2.7

5
推荐指数
1
解决办法
122
查看次数

标签 统计

matplotlib ×1

python ×1

python-2.7 ×1