matplotlib 1.2.1与对数轴和条形图一起失败

matplotlib 1.2.1与对数轴和条形图一起失败,matplotlib,enthought,Matplotlib,Enthought,以下代码应产生两个相同的重叠直方图 x = scipy.random.normal(0,1,100) f = figure(num=1) f.clear() ax = f.add_subplot(111) ns,bns,plt0 = ax.hist(x,bins=10,log=True) plt1 = ax.bar(bns[0:-1],ns,width=bns[1:]-bns[0:-1],color='r',log=True) draw() 但是,它在以“plt1=ax.bar”开头的线路

以下代码应产生两个相同的重叠直方图

x = scipy.random.normal(0,1,100)

f = figure(num=1)
f.clear()
ax = f.add_subplot(111)
ns,bns,plt0  = ax.hist(x,bins=10,log=True)
plt1 = ax.bar(bns[0:-1],ns,width=bns[1:]-bns[0:-1],color='r',log=True)
draw()
但是,它在以“plt1=ax.bar”开头的线路上失败,错误如下:

...
 File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/transforms.py", line 786, in from_bounds
   return Bbox.from_extents(x0, y0, x0 + width, y0 + height)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'float' 

在线查看后,这似乎是Enthow's Canopy和matplotlib的Macport的一个问题。由于matplotlib邮件列表上没有其他人报告此错误,我认为它来自Macports和Enthough使用的配置。

在Corporation 1.0.3下,matplotlib 1.2.1也有类似的情况,但matplotlib 1.2.0没有。不能确定,但考虑到这一点,以及它在Macports中的出现,很可能这是一个matplotlib回归。添加matplotlib标记