I am trying to create plots for school students in lilaq, and have used the schoolbox-style from the documentation and set the alignment for the axes to be “top”/“right”.
#show: schoolbook-style
#show lq.selector(lq.label): set align(top + right)
#let xvals = lq.linspace(0, 10)
#lq.diagram(
ylim: (-2, auto),
xlabel: [$x$],
ylabel: [$y$],
lq.plot(xvals, xvals.map(x => calc.sin(x) + 2),
mark: none,
smooth: true)
)
The default behaviour with my current code is to have the axes labels in the following locations, which is not where I want them.
I can move the axes labels to where I want them, but this method does not seem particularly robust (and is probably dependent on the font choices and other factors).
xlabel: lq.xlabel(dx: 0.8em, dy: -2.4em)[$x$],
ylabel: lq.ylabel(angle: 0deg, dx: 2.8em, dy: -1.2em)[$y$],
Is there a way I can have these axes labels where I want them without resorting to using dx and dy in this fashion?