您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

python – matplotlib stepfilled直方图在xubuntu上的值为10 ^ -1

5b51 2022/1/14 8:22:02 python 字数 2770 阅读 517 来源 www.jb51.cc/python

为什么当代码通过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

概述

为什么当代码通过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")

应该是什么样的:

Correct image stepping past 10**-1

它实际上是什么样的:

Broken output

我目前在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所遇到的程序开发问题。


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶