79472142

Date: 2025-02-27 09:17:28
Score: 0.5
Natty:
Report link
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()

figure

Reasons:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: newstudent