Histogram with uneven heights within bins
<p>Why does my histogram look like this? I'm plotting it using the following code:</p>

<pre><code>import matplotlib.pyplot as plt

n, bins, patches = plt.hist(data, 25)
plt.show()
</code></pre>

<p>where <code>data</code> contains about 500,000 sorted points. Shouldn't each bin be smooth at the top?</p>

<p><a href="http://i.stack.imgur.com/fL8hB.png" rel="nofollow"><img src="http://i.stack.imgur.com/fL8hB.png" alt="enter image description here"></a></p>

<p>I think <a href="http://matplotlib.org/examples/statistics/histogram_demo_histtypes.html" rel="nofollow">this example from the matplotlib gallery</a> displays the kind of plot you want. Therefore, you should either use <code>histtype="stepfilled"</code> or <code>histtype="bar"</code>.</p>

python matplotlib