Open twest820 opened 2 weeks ago
Thanks for the report! The first example does not throw an error in the current development version, so I don't think it needs a fix at the moment. I agree with you that the second example should simply return an empty plot.
Hitting some instances where
geom_col() + scale_y_discrete()
errors out instead of producing an empty plot when given no data.I've encountered two different failure modes with ggplot 3.5.1 in R 4.4. repexes below simplified from actual use.
Workaround's to check for empty tibbles and skip
+ scale_y_discrete()
when they occur. Easy enough but it seems atypical for ggplot that callers need to check for and handle the no data case. Also seems curious explicitly specifying a defaultscale_y_discrete()
fails but leaving it implicit succeeds.