I have a scatterplot where both axes are in logarithmic scale. For instance, a plot generated with the following code:
import matplotlib.pyplot as plt
import numpy as np
rng = np.random.RandomState(42)
x = np.logspace(0, 3, 100)
y = np.logspace(0, 3, 100) + rng.randn(100) * 2
ax = plt.gca()
ax.scatter(x, y, marker="x", color="orange")
ax.axline((0, 0), (1, 1), color="black", linestyle=":")
ax.set_xscale("log")
ax.set_yscale("log")
ax.set_aspect("equal")
plt.show()
that produces the following plot Scatter plot with bisector
I would like to draw diagonal lines in correspondence of each power of 10, for instance as in the following plot Scatter plot with bisector and two diagonal lines
I tried to add
ax.axline((1, 0), (10, 1), color="black", linestyle=":")
ax.axline((0, 1), (1, 10), color="black", linestyle=":")
but I get Scatter plot with bisector and two lines which is not what I expected.