title: How to move color scale labels to middle of colored fields in matplotlib/xarray?
body: <p>I have a heatmap with discrete values (=categories/factors), created as follows:</p>
  
  <pre><code>import xarray
  dats =  xarray.DataArray([[2,4,3,5,1],[8,4,5,3,2], [9,3,4,4,1]])
  dats.plot(levels=range(0, 11, 1), cmap='Blues')
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lwGxI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lwGxI.png" alt="Heatmap"></a></p>
  
  <p>I would like to move the numbers at the color scale / legend to the middle of the respective field. I (and colleagues) find their position at the intersection of fields a bit misleading, especially considering that the ticks at the x-axis in the heatmap itself are in the very middle of the fields. </p>
  
  <p>How can I move those values at the color scale up to the middle of the fields (and cut off the 10, which is not a value in the data set)?</p>