Open earowang opened 4 years ago
Actually, the graphical issue also applies to zoo::yearmon()
.
I'll be completely honest, I don't have much experience creating scales, but I'd guess that we'd have to create one for ymon anyways since it has a different granularity than Date, rather than just using Date's directly. I'm not really sure though
Granularity isn't the issue. pretty()
handles Date
s in monthly intervals very well. The ticks and labels in the plots above are perfect, except for "Jan" out of plot limits. This didn't occur to yearmonth
when subclassing Date
. However, when explicitly converting to Date
, the issue pops out. "Jan" should be interpreted as NA
, but it is somehow changed to 0
when building ggplot.
Anyway, that is my primary motivation for inheriting from Date
, without creating my own scale_x_*()
.
Hi Davis,
Regarding https://github.com/r-lib/vctrs/issues/1154
It used to work nicely with scales, when subclassing
Date
. Although we use different underlying representations betweenyearmonth
andymon
, the axis issue remains the same. When the limit difference is small, the labels fall out of the plotting range.Created on 2020-06-19 by the reprex package (v0.3.0)