🏠 back to Observable

Histogram with Plot does not show a bar for a single value array

Hi. I created a histogram from the example in Bin Transform / Observable Plot / Observable / Observable, but it does not show anything when the data contain only one value, while I was thinking it would show a single bar.

Plot.rectY([{ weight: 3 }], Plot.binX({ y: "count" }, { x: "weight" })).plot()

See Plot histogram of a single value array / Sylvain Lesage / Observable

Did I miss something?

Interesting avatar of Issues · observablehq/plot · GitHub thanks!

(you can “fix” it temporarily by adding inset:-.5)

1 Like