plot icon indicating copy to clipboard operation
plot copied to clipboard

Plot with inset, axis marks and two bands has wrong auto height

Open mootari opened this issue 9 months ago • 2 comments

If a plot specifies an inset as well as axis marks, then the resulting height causes y labels to overlap if the data only produces two bands:

Plot.plot({
  inset: 20,
  marks: [
    Plot.axisX({anchor: "top"}),
    Plot.axisX({anchor: "bottom"}),
    Plot.dot("AB", {y: d => d, x: 0})
  ]
})

Screenshot:

Image

mootari avatar May 28 '25 17:05 mootari

I don’t think the auto height accounts for insets. Not sure if we can do that, so this might be intended behavior.

mbostock avatar May 28 '25 20:05 mbostock

@mbostock Should I turn the issue into a feature request to consider insets when calculating the height?

mootari avatar May 28 '25 22:05 mootari