x, y = np.random.random((2, 1000))
x = 10 ** x
xbins = 10 ** np.linspace(0, 1, 10)
ybins = np.linspace(0, 1, 10)
fig, ax = plt.subplots()
ax.hist2d(x, y, bins=(xbins, ybins))
ax.set_xscale('log')
plt.show()
Creating a log-linear plot in matplotlib using hist2d