title: python matplotlib heatmap colorbar from transparent
body: <p>How to implement python matplotlib heatmap colorbar like this？</p>
  
  <p><a href="https://i.stack.imgur.com/5sHpH.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/5sHpH.jpg" alt="enter image description here"></a></p>
  
  <pre><code>plt.imshow(a,aspect='auto', cmap=plt.cm.gist_rainbow_r)
  plt.colorbar()
  </code></pre>