-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ggpattern doesn't seem to work with latest DEV version #5608
Comments
This is a more minimal reprex devtools::load_all("~/packages/ggplot2")
# or:
# library(ggplot2) # if dev version is installed
#> ℹ Loading ggplot2
library(ggpattern)
df <- data.frame(x = c(1, 2, 3), y = c(1, 2, NA), fill = c("A", "B", NA))
ggplot(df, aes(x, y, fill = fill, pattern = fill)) +
geom_col_pattern()
#> Warning: The `scale_name` argument of `discrete_scale()` is deprecated as of ggplot2
#> 3.5.0.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_col_pattern()`).
#> Error in if (pat == "regular_polygon" && is.numeric(params$pattern_shape)) params$pattern_shape <- "convex6": missing value where TRUE/FALSE needed Seems to be solved by setting a last_plot() + scale_pattern_discrete(na.value = "crosshatch")
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_col_pattern()`). Created on 2024-01-02 with reprex v2.0.2 |
Seems to be caused by #5519, where missing values are no longer silently removed by library(ggplot2)
library(ggpattern)
df <- data.frame(x = c(1, 2, 3), y = c(1, 2, NA), fill = c("A", "B", NA))
ggplot(df, aes(x, y, fill = fill, pattern = fill)) +
geom_col_pattern(position = 'identity')
#> Warning: Removed 1 rows containing missing values (`geom_col_pattern()`).
#> Error in if (pat == "regular_polygon" && is.numeric(params$pattern_shape)) params$pattern_shape <- "convex6": missing value where TRUE/FALSE needed Created on 2024-01-02 with reprex v2.0.2 In any case, as we're unlikely to revert #5519, it seems like the most suitable fix is for {ggpattern} to set a |
Created on 2023-12-22 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: