-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Enable 2D structures as aesthetics #6076
Conversation
I'm unsure why the coverage CI is failing |
TODO: check errors in scales |
Also incorporated #6090 as it is thematically related in the sense of "ggplot2 should give vctrs treatment to input". devtools::load_all("~/packages/ggplot2")
#> ℹ Loading ggplot2
p <- ggplot(mpg, aes(displ, hwy)) +
geom_point() +
scale_x_continuous(
breaks = 2:7,
labels = data.frame(foo = LETTERS[1:6], bar = 1:6)
)
get_guide_data(p, aesthetic = "x")
#> x .value .label.foo .label.bar y
#> 1 0.1127946 2 A 1 0
#> 2 0.2811448 3 B 2 0
#> 3 0.4494949 4 C 3 0
#> 4 0.6178451 5 D 4 0
#> 5 0.7861953 6 E 5 0
#> 6 0.9545455 7 F 6 0 Created on 2024-09-20 with reprex v2.1.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge branch 'main' into vctrs_columns # Conflicts: # R/scale-.R # R/utilities.R
This PR aims to fix #4189 and fix #6090.
Briefly, this PR would allow people to use 2D structures like matrices, data.frames and tibbles as aesthetics.
We just had to adopt the {vctrs} way of measure sizes and setting names at select places for this to.
Importantly, this does not implement appropriate scales for such aesthetics, but it removes a barrier for extension developers to implement them.
Created on 2024-09-04 with reprex v2.1.1