You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently installed matplotlib 1.3.0, and it seems that pylab.hist() doesn't work as expected when using histtype='step'. The line closing the histogram on its right side is not drawn, leaving the histogram open. This was not the case for matplotlib 1.2, and seems to be present on different system.
The attached plot shows the result obtained using the following lines of code:
I was looking at the /matplotlib/axes.py (still version 1.3.0 of matplotlib) code and it seems that the problem could come from the following part of the code, in the hist() function (line 8482):
if fill:
.....
else:
split = int(len(x) / 2) + 1 # here
patches.append(self.fill(
x[:split], y[:split], # and here
closed=False, edgecolor=c,
fill=False))
'x[:split]' should includes the index 'split', but doesn't. Adding 1 to 'split' could resolve this issue.
Hello,
I recently installed matplotlib 1.3.0, and it seems that pylab.hist() doesn't work as expected when using histtype='step'. The line closing the histogram on its right side is not drawn, leaving the histogram open. This was not the case for matplotlib 1.2, and seems to be present on different system.
The attached plot shows the result obtained using the following lines of code:
import pylab
pylab.hist(pylab.rand(50), histtype='step')
pylab.show()
This problem does not appear when I'm plotting a 'stepfilled' or 'bar' histogram.
Thank you for any feedback,
Nicolas Chotard
The text was updated successfully, but these errors were encountered: