I have a large data set that is logarithmic in distribution. I want to make a heat map, so I do a 2D histogram and pass that to implot. Because the data is logarithmic, I am passing the log of the data to the histogram. When I make the plot, however, I want the axis to be restored (ie 10^hist bin values) and log axes. If I set the axis to log style, then the image looks all skewed. The data is already 'logged' from when I passed it to the histogram, so I don't want the image affected, just the axis. So, in the below example, I want the image on the left with the axis on the right.
I guess I could do it with a fake overlayed axis, but I don't like to do that sort of thing if there's a better way...
import numpy as np
import matplotlib.pyplot as plt
x=10**np.random.random(10000)*5
y=10**np.random.random(10000)*5
samps, xedges, yedges = np.histogram2d(np.log10(y), np.log10(x), bins=50)
ax = plt.subplot(121)
plt.imshow(samps, extent=[0,5,0,5])
plt.xlabel('Log10 X')
plt.ylabel('Log10 Y')
ax = plt.subplot(122)
plt.imshow(samps, extent=[10**0,10**5,10**0,10**5])
plt.xlabel('X')
plt.ylabel('Y')
plt.xscale('log')
plt.yscale('log')
plt.show()