title: Why doesn't the `normed` parameter for matplotlib histograms do anything?
body: <p>I'm confused by the <code>normed</code> argument from <a href="https://matplotlib.org/api/pyplot_api.html?highlight=matplotlib%20pyplot%20hist#matplotlib.pyplot.hist" rel="nofollow noreferrer">matplotlib.pyplot.hist</a> and why it does not change the plot output:</p>
  
  <blockquote>
    <p>If True, the first element of the return tuple will be the counts
    normalized to form a probability density, i.e., <code>n/(len(x)'dbin)</code>, i.e.,
    the <strong>integral of the histogram will sum to 1</strong>. If <code>stacked</code> is also True,
    the sum of the histograms is normalized to 1.</p>
    
    <p>Default is False</p>
  </blockquote>
  
  <p>Seems pretty clear.  I've seen it called a density function, probability density, etc.  </p>
  
  <p>That is, given a random uniform distribution of size 1000 in [0, 10]:</p>
  
  <p><a href="https://i.stack.imgur.com/YnklF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YnklF.png" alt="enter image description here"></a></p>
  
  <p>Specifying <code>normed=True</code> should change the y-axis to a density axis, where the sum of the bars is 1.0:</p>
  
  <p><a href="https://i.stack.imgur.com/NThY5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NThY5.png" alt="enter image description here"></a></p>
  
  <p>But in reality it does nothing of the sort:</p>
  
  <pre><code>r = np.random.uniform(size=1000)
  plt.hist(r, normed=True)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/SddWG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SddWG.png" alt="enter image description here"></a></p>
  
  <p>And furthermore:</p>
  
  <pre><code>print(plt.hist(r, normed=True)[0].sum())
  # definitely not 1.0
  10.012123595
  </code></pre>
  
  <p>So, I have seen @Carsten König's <a href="https://stackoverflow.com/a/16399741/7954504">answers</a> to similar questions and am not asking for a workaround.  My question is, what then is the purpose of <code>normed</code>?  Am I misinterpreting what this parameter actually does?</p>
  
  <p>The matplotlib <a href="http://matplotlib.org/examples/pylab_examples/histogram_percent_demo.html" rel="nofollow noreferrer">documentation</a> even gives an example named "histogram_percent_demo", where the integral looks like it would be over a thousand percent.</p>