Makie: Unable to position Legend

Hi all,

I am trying to get a figure done with Makie. I am having trouble setting the position of my legend so it does not intersect with the lines. I have checked Legend · Makie , but that only says that I can use combinations of left, center, right with top, center, bottom. I tried to feed a tuple of floats to the position argument and it seems to accept them, but the Legend does not appear to change its position, no matter which numbers I put. Also, the possibility of feeding tuples to the position argument is not documented anywhere, but it is discussed here: Can you do fine adjustment on legend position in Makie?

My code is something like

axislegend(axis, position=(0.1, 0.8), framevisible=false, rowgap=0, patchlabelgap=1, patchsize=(10,10))

What is the best way to fine-tune the Legend position with Makie? Thank you!

The position = (0.2, 0.8) syntax works for me with CairoMakie 0.10.5
MWE:

fig = Figure();
ax = fig[1,1] = Axis(fig);
lines!(ax, 1:10, 1:10; label = "x");
axislegend(ax, position = (0.5, 0.5));

Perhaps you are using a different backend or version?

Hi, thank you for your answer, and sorry for the late reply.

To me, it seems that the problem is that the figure size I was working with was small (I am using the physical dimensions of the graph, 246.0pt of width). When I increase to two-columns, 510 pt, I could slightly position the legend. Is there any kind of autopositioning?

I am not aware of an intelligent legend position argument that avoids overlapping data. I have come to prefer to place legends outside of the plots.