Skip to content
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

Malformed old guides #6165

Open
teunbrand opened this issue Oct 28, 2024 · 0 comments · May be fixed by #6167
Open

Malformed old guides #6165

teunbrand opened this issue Oct 28, 2024 · 0 comments · May be fixed by #6167
Labels
bug an unexpected problem or unintended behavior guides 📏

Comments

@teunbrand
Copy link
Collaborator

This is what it should look like if you add a modern guide to guides():

devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2

guides(x = guide_axis())
#> <Guides[1] ggproto object>
#> 
#> x : <GuideAxis>

However, an old S3 guide is stored incorrectly. You can see that by the guides printing as if fields of the S3 guide are separate guides:

guides(x = ggprism::guide_prism_minor())
#> 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.
#> <Guides[8] ggproto object>
#> 
#>         title : <waiver> 
#> check.overlap : "none"   
#>         angle : <NULL>   
#>       n.dodge : <numeric>
#>         order : <numeric>
#>      position : <waiver> 
#> available_aes : "x"      
#>          name : "y"      
#>         title : "axis"

Created on 2024-10-28 with reprex v2.1.1

The issue stems from #6022 in that we now use is.guide() here, which tests for the modern ggproto guide, while this clause was specifically designed for old S3 guides:

if (is.list(args[[1]]) && !is.guide(args[[1]])) args <- args[[1]]

@teunbrand teunbrand added bug an unexpected problem or unintended behavior guides 📏 labels Oct 28, 2024
@teunbrand teunbrand linked a pull request Oct 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior guides 📏
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant