title: Save 2D histogram as heatmap in python
body: <p>I'm trying to plot 2D histogram as heat map.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>def save_2d_hist(hist2D):
      import pylab as pl
      print hist2D.shape
  
      pl.pcolor(hist2D)
      pl.colorbar()
      pl.savefig('graph.png')
  </code></pre>
  
  <p>My hist is (11L, 10L) but the picture that I get have 12 rows, how can I fix it?</p>
  
  <p><a href="https://i.stack.imgur.com/vJd7E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vJd7E.png" alt="enter image description here"></a></p>