Closed
Description
The old guide system used lists. This trips up a check in guides()
, which throws this spurious warning:
library(ggplot2)
old_guide <- metR:::guide_colourstrip()
is.list(old_guide)
#> [1] TRUE
new_guide <- guide_colorbar()
is.list(new_guide)
#> [1] FALSE
mtcars |>
ggplot(aes(gear, carb)) +
geom_point() +
guides(fill = old_guide)
#> Warning: The `<scale>` argument of `guides()` cannot be `FALSE`. Use "none" instead as
#> of ggplot2 3.3.4.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
The problem is here:
Lines 76 to 83 in 97edd62
Line 76 seems to be there to support a guides(list(fill = ..., colour = ...))
syntax. But when using the old guide system, the logic makes args
point to the first guide. Then line 79 iterates over the elements of the guide and if one of them is FALSE
then it converts it to "none" and throws the warning.
Metadata
Metadata
Assignees
Labels
No labels