plot icon indicating copy to clipboard operation
plot copied to clipboard

Multi-line date labels can collide with scale label

Open tophtucker opened this issue 2 years ago • 2 comments

If the date axis is not named one of the special names we suppress, the axis label may collide with the tick labels. (I see why this happens and auto margins are very tricky but I wanted an issue to track this.)

untitled (65)

Plot.plot({
  marks: [
    Plot.rectY(pizza, Plot.binX({ y: "count" }, { x: "order_date", tip: true })),
    Plot.ruleY([0])
  ]
})

tophtucker avatar Sep 13 '23 17:09 tophtucker

Wouldn't you want to leave the margin as is, and remove 2023?

Fil avatar Sep 13 '23 17:09 Fil

In this specific case, I’d really probably just want to remove the label “order_date”. But I can imagine wanting a label on a date axis and wanting it to adjust automatically if it’s multi-line. Though I know it may not be easy to infer if it’s multi-line! So maybe this is more similar to https://github.com/observablehq/plot/issues/383.

tophtucker avatar Sep 13 '23 17:09 tophtucker