-
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
Could scale_*_manual
have a default values
argument of NULL
?
#5653
Comments
What would be the intended outcome of the manual scale without values? |
The outcome is that the manual scale turns up with NULL values, which would do whatever ggplot2 would do by default for the values if scale layer wasn't called |
In the example below, I want the same graph to be produced without me having to specify what the values are library(tidyverse)
library(palmerpenguins)
ggplot(mtcars, aes(mpg, wt)) +
geom_point(aes(colour = factor(cyl))) +
scale_colour_manual(values = scales::pal_hue()(3), breaks = c(4, 6)) Created on 2024-01-21 with reprex v2.1.0 |
scale_*manual
have a default values
argument of NULL
?scale_*_manual
have a default values
argument of NULL
?
Right, I think this falls under the umbrella of #4269. To briefly recap, it has been on the wishlist for a while to set scale parameters without explicitly declaring the scale itself. This is similar to your example where you want to set the breaks but not other parameters, such as the palette. There have been several attempts at implementing this, namely two in #4271 and one in #5444. That said, using |
Thanks @teunbrand the partial scales thing looks super useful. With regard to the scale_*_manual layers, can you not just make the values argument NULL, and then tell it to do the standard defaults when it is NULL? Assume it's not that simple?? |
The scale_*_manual functions are super useful. Is it possible that the values argument in these could default to NULL? This would allow users familiar with them to use them to change other non-values aspects of the scale through these functions
Created on 2024-01-20 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: