plot icon indicating copy to clipboard operation
plot copied to clipboard

When all the values are integers, skip fractional ticks?

Open Fil opened this issue 4 years ago • 2 comments

Capture d’écran 2021-05-03 à 11 13 59

the axis should show 1, 2, instead of 1.0, 1.5, 2.0

Fil avatar May 03 '21 09:05 Fil

Auto-detecting when this situation happens is more difficult than it seems at first glance.

And it could be argued it's a type of scale (type="integer"), rather than a type of ticks. The difference would show in an example where, say, data covers the years 2019, 2020 and 2021. The color legend would become ordinal rather than continuous. 🤔

Fil avatar Feb 07 '22 15:02 Fil

Feels related to ordinal intervals #513?

mbostock avatar Feb 07 '22 16:02 mbostock

#1790 handles some of these cases. I think the remaining case is covered by #1013 (which is generalizable beyond integers, such as time intervals). Maybe we can close this issue now?

mbostock avatar Aug 23 '23 20:08 mbostock