title: Hist in matplotlib: Bins are not centered and proportions not correct on the axis
body: <p>take a look at this example:</p>
  
  <pre><code> 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()
  </code></pre>
  
  <p>The output is posted as a picture. I have two questions:</p>
  
  <p>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?</p>
  
  <p>b)Why are the bins not normalised to proportion? I want the y values of all the bins to sum up to one.</p>
  
  <p>Note that my real example contains much more values in the list, but they are all discrete.</p>
  
  <p><img src="https://i.stack.imgur.com/6wA6M.png" alt="enter image description here"></p>