Issues with heat map in matplotlib : <p>I am trying to draw a heat map in matplotlib in two ways:</p>

<pre><code>plt.figure(figsize=(8, 6))
heatmap, xedges, yedges = np.histogram2d(rtl, zs, bins=(128, 128))
extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]]

plt.clf()
plt.xscale('log')

plt.imshow(heatmap, extent=extent)
plt.show()
</code></pre>

<p>The second way is:</p>

<pre><code>fig, ax = plt.subplots(figsize=(8, 6))

hb = ax.hexbin(rtl, zs, gridsize=50)
ax.axis([min(rtl), max(rtl), min(zs), max(zs)])
plt.show()
</code></pre>

<p>But for the same data, I am getting really different plots. I am not understanding what is going on here.</p>

<p><a href="https://imagebin.ca/v/3YHcqeoi87O9" rel="nofollow noreferrer">plot1</a>
<a href="https://imagebin.ca/v/3YHdD8YftGir" rel="nofollow noreferrer">plot2</a></p>
