How to rotate or reposition axis labels in lilaq?

You can pass a label to the parameters xlabel and ylabel to adjust the angle and the position.

#lq.diagram(
  xlabel: lq.xlabel($x$, dx: 0.3cm, dy: -0.7cm, angle: 0deg),
  ylabel: lq.ylabel($y$, dx: 0.9cm, dy: -0.4cm, angle: 0deg),
  lq.plot(
    mark: none,
    stroke: 1.5pt,
    x,
    x.map(x => 
      calc.pow(x,2)  
    )
  ),
)

I’m not sure if there is also a way to do this with a show rule? But since the position probably needs to be customized for every plot anyway, I think it is fine to create the elements here manually.

2 Likes