title: matplotlib histogram bins do not work well
body: <pre><code>plt.hist([1, 2, 1], bins=np.arange(1, 3, 0.1))
  </code></pre>
  <p>Why does the plot look like
  <a href="https://i.stack.imgur.com/SYSej.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SYSej.png" alt="this" /></a></p>
  <p>The bar of 2 should be in the right of bin 2.</p>