-
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
Deprioritise annotations in deriving labels #6316
Comments
I think the general rule would be to use global aesthetics before layer-specific aesthetics. Not sure how easy that would be to implement. This might require a complete rethinking of when and how axis titles are defined. |
We explicitly avoided that approach based on #5894. |
I see. I guess there's always going to be edge cases that are difficult to catch. In the end, people can always override labels manually if they need to. |
True enough. Just to repeat a bit of reasoning from the original discussion, an argument why annotations should be skipped is that the annotation's aesthetics is not (directly) 'mapped data' unlike regular layers. In addition, it will always give 'x' as the default label for the |
Arguably we also shouldn't let devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2
ggplot(mpg, aes(displ, hwy)) +
expand_limits(x = c(0, 10)) +
geom_point() Created on 2025-02-05 with reprex v2.1.1 |
This was first suggested in tidyverts/feasts#166 (comment).
When you use an annotation you want to use as the background, you use that annotation before the real 'data' layers. For example, to highlight the 70s you can use:
Created on 2025-01-31 with reprex v2.1.1
However the default label is now
x
and notdate
and the question is whether we should deprioritise annotations in deriving automatic labels? Currently, there is nothing distinguishing an annotation layer from a regular layer beyond the constructor.The text was updated successfully, but these errors were encountered: