You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following should create a blank plot without erroring, but does not after #3426. This should probably be fixed in the same PR as #3448.
library(ggplot2)
ggplot(data.frame(x=numeric(0)), aes(x)) +
geom_point() +
scale_x_continuous(limits= c(0, NA))
#> Warning in rep(yes, length.out = len): 'x' is NULL so the result will be#> NULL#> Error in ans[ypos] <- rep(yes, length.out = len)[ypos]: replacement has length zero
The offending code is here (where self$limits is not NULL and self$range$range is NULL):
I think that Scale$get_limits() needs another case for limits containing NA (or Scale$is_emtpy() should return TRUE for these limits). @thomasp85 any opinion on either of these solutions?
The text was updated successfully, but these errors were encountered:
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/
lockbot
locked and limited conversation to collaborators
May 20, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The following should create a blank plot without erroring, but does not after #3426. This should probably be fixed in the same PR as #3448.
The offending code is here (where
self$limits
is notNULL
andself$range$range
isNULL
):ggplot2/R/scale-.r
Lines 439 to 452 in 10fa001
I think that
Scale$get_limits()
needs another case for limits containingNA
(orScale$is_emtpy()
should returnTRUE
for these limits). @thomasp85 any opinion on either of these solutions?The text was updated successfully, but these errors were encountered: