tmp = np.pad(tmp, (1, 0), 'constant')
return np.interp(np.linspace(0, tmp.max(), nbin + 1), tmp, np.sort(x))
n, bins, patches = plt.hist(x, histedges_equalA(x, nbin), normed=False)
Matplotlib: How to make a histogram with bins of equal area?