I am not sure if this is a bug or if I am simply misinterpreting the output of matplotlib's cumulative histogram. E.g., what I expect is "at a certain x value, the corresponding y-value tells me how many samples are <= x."
import matplotlib.pyplot as plt
X = [1.1, 3.1, 2.1, 3.9]
n, bins, patches = plt.hist(X, normed=False, histtype='step', cumulative=True)
plt.ylim([0, 5])
plt.grid()
plt.show()
See the 2nd vertical line at x=1.9
? Shouldn't it be at 2.1 given the data in X
? E.g., at x=3 I would read "3 samples have a value x <= 3.1" ...
So, basically what I would expect is something similar to this step plot.
plt.step(sorted(X), range(1, len(X)+1), where='post')
plt.ylim([0, 5])
plt.grid()
Edit:
I am using python 3.4.3 & matplotlib 1.4.3