import numpy as np
import matplotlib.pyplot as plt
field = [np.random.rand(10000), np.random.rand(10000)] # Replace this with your data
# Create bins with logarithmic spacing
x_bins = np.logspace(np.log10(np.min(field[0])), np.log10(np.max(field[0])), 50)
y_bins = np.logspace(np.log10(np.min(field[1])), np.log10(np.max(field[1])), 50)
fig, ax = plt.subplots(figsize=(8, 6))
c = ax.hist2d(field[1], field[0], bins=[y_bins, x_bins], norm='log')
fig.colorbar(c[3], ax=ax)
ax.set_xscale("log")
ax.set_yscale("log")
plt.show()
