take a look at this example:
import matplotlib.pyplot as plt
l = [3,3,3,2,1,4,4,5,5,5,5,5,5,5,5,5]
plt.hist(l,normed=True)
plt.show()
The output is posted as a picture. I have two questions:
a) Why are only the 4 and 5 bins centered around its value? Shouldn't the others be that as well? Is there a trick to get them centered?
b)Why are the bins not normalised to proportion? I want the y values of all the bins to sum up to one.
Note that my real example contains much more values in the list, but they are all discrete.