title: How to make a heatmap using Matplotlib with a specific pixel size for each cell?
body: <p>I can easily make my heatmap using</p>
  
  <pre><code>data = np.random.rand(4,4)
  fig, ax = plt.subplots()
  heatmap = ax.pcolor(data, cmap=plt.cm.Blues)
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1HIuQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1HIuQ.png" alt="enter image description here"></a></p>
  
  <p>However as you can see each cell is rectangular and I'd like each one to be square (32 x 32 pixels), generating a 512 x 512 pixel image.</p>
  
  <p>Is there a way of forcing the plot (or each individual cell) to be of a specific pixel size?</p>
  
  <p><strong>Edits</strong>: </p>
  
  <ul>
  <li>my screen DPI is 100</li>
  <li>I'd like the actual heatmap to be 512 x 512 and
  <strong>not</strong> the entire figure</li>
  </ul>