Description
labelOffset moves the axis label in the direction orthogonal to the axis (say horizontally for the y axis). But how would you move it in the direction of the axis?
Suppose you want to move the axis label down (because there is a scale.insetTop or a large marginTop).
A hacky solution (implemented in https://observablehq.com/@recifs/a-centered-title) is an explicit label with lots of \n (spaces if working on the x axis)
Plot.axisY({ label: "\n\n\n\n\n↑ flipper_length_mm" }),
Similarly, a text mark with facetAnchor+frameAnchor.
Note: dy doesn't apply to the axis label (this is probably a bug in itself? this was intentional); if this worked, we could create a specific axis just for the label, and offset it. It would be tedious, but would benefit from the automatic label.
I think we should:
-
fix the bug with dy (axis dx and dy must be applied to the axis label too #1517) - introduce a new option orthogonal to labelOffset (name?) (axis label inset #1516)