# assuming that mydata is an numpy array ax.hist(mydata, weights=np.zeros_like(mydata) + 1. / mydata.size)
ax.hist(mydata, weights=np.ones_like(mydata) / mydata.size)