Hello! Consider the following code:
using CairoMakie
x = 1:100
y = randn(length(x))
theme = Theme(
Legend=(
padding=(50, 10, 10, 10),
margin=(50, 50, 50, 50)
)
)
with_theme(theme) do
fig = Figure(resolution=(300, 300))
axis = Axis(fig[1, 1], xscale=log2)
lines!(axis, x, y, label="test")
axislegend(axis, position=:rb)
save("test.pdf", fig, pt_per_unit=1)
end
It produces this image

Notice that the legend applied padding as specified by the theme, yet it ignored margin. To set margin, one needs to pass it as an argument, axislegend(..., margin=...).
Is that the intended behavior?