(Plots.jl) Aspect ratio for log-log plots

It seems that Plots.jl doesn’t respect aspect_ratio=1.0 for log-log plots. This is particularly annoying since particular slopes have meaning in such plots (order of polynomial growth). I saw this mentioned in passing in an earlier post:

(Edit: Made the link more precise; it’s not the focus of the post, but mentions the issue in passing.)

Does anyone have a workaround?

A naive workaround for a static plot (that you don’t often change) is to use the keyword xticks and yticks to manually choose and format the tick labels. Then you plot the logarithm values on the default scale, with aspect_ratio=1.0.

PS. Please file an issue at Plots.jl at your convenience.

1 Like

One workaround (for the MWE below) is to give a hand to Plots.jl in defining the plot limits:

using Plots
x = 10 .^(0:9)
y = x .^2
z0, z1 = extrema([x; y])
plot(x, y, axis=:log, ratio=1, lims=(z0,z1))