title: Matplotlib stretches histogram2d vertically
body: <p>I'm using this code:</p>
  
  <pre><code>fig = plt.figure(num=2, figsize=(8, 8), dpi=80,
                   facecolor='w', edgecolor='k')
  x, y = [xy for xy in zip(*self.pulse_time_distance)]
  H, xedges, yedges = np.histogram2d(x, y, bins=(25, 25))
  extent = [-50, +50, 0, 10]
  plt.imshow(H, extent=extent, interpolation='nearest')
  plt.colorbar()
  </code></pre>
  
  <p>to produce a 2D histogram, however, the plot is stretched vertically and I simply can't figure out how to set its size properly:</p>
  
  <p><img src="https://i.stack.imgur.com/ypYEK.png" alt="Matplotlib stretches 2d histogram vertically"></p>