Relative text position in Makie in log scale

I want to specify the position of the text relative to the axis. I tried the following:

fig = Figure()

ax1 = Axis(fig[1,1], xscale=log10, yscale=log10)
text!(ax1, 0.1, 0.9, text="testing", align=(:left, :top), space=:relative)
limits!(ax1, 0.01, 1, 0.01, 1)

ax2 = Axis(fig[1,2], xminorticksvisible=true, yminorticksvisible=true,
    xminorgridvisible=true, yminorgridvisible=true,
    xminorticks=0.1:0.1:0.9, yminorticks=0.1:0.1:0.9)
text!(ax2, 0.1, 0.9, text="testing", align=(:left, :top), space=:relative)
limits!(ax2, 0, 1, 0, 1)

fig

On the right axis, the position of the text is where I want, but for the left axis which is in log scale, the text doesn’t appear in the position I expected (should be the same as the right linear-linear axis). What’s the proper way to specify relative position of the text in loglog plot?

I ran your code as is and it worked for me (“testing” is in the same place for both plots). Are you using the latest version of Makie (0.19.0)?

This was fixed just recently and is now available in >= v0.18.4

1 Like