79457937

Date: 2025-02-21 15:56:27
Score: 0.5
Natty:
Report link

You will probably need to add the log value to both the x and y scale.

Example:

n=500

x = np.log(np.linspace(10, 1000, num = n))
y = np.log([random.randint(10, 1000) for _ in range(n)])

plt.scatter(np.sort(x), np.sort(y), alpha=0.6, edgecolor='k', s=130)


# Plot 45 degrees reference line
dmin, dmax = np.min([x,y]), np.max([x,y])
diag = np.linspace(dmin, dmax, 1000)
plt.plot(diag, diag, color='red', linestyle='--')
plt.gca().set_aspect('equal')

plt.yscale('log')
plt.xscale('log')

plt.show()

Output:

Figure

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