matplotlib histogram: how to display the count over the bar?
<p>With matplotlib's <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html" rel="nofollow noreferrer"><code>hist</code></a> function, how can one make it display the count for each bin over the bar?</p>
<p>For example,</p>
<pre><code>import matplotlib.pyplot as plt
data = [ ... ] # some data
plt.hist(data, bins=10)
</code></pre>
<p>How can we make the count in each bin display over its bar?</p>