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

Option to make default colour schemes accessible? #4696

Closed
hadley opened this issue Dec 13, 2021 · 4 comments · Fixed by #5946
Closed

Option to make default colour schemes accessible? #4696

hadley opened this issue Dec 13, 2021 · 4 comments · Fixed by #5946
Labels
feature a feature request or enhancement scales 🐍

Comments

@hadley
Copy link
Member

hadley commented Dec 13, 2021

It would be a shortcut for changing all of the default colour/fill scales.

@hadley hadley added feature a feature request or enhancement scales 🐍 labels Mar 14, 2022
@yutannihilation
Copy link
Member

Related: #4466

@teunbrand
Copy link
Collaborator

teunbrand commented Jun 21, 2024

Proposal in #5946 is to run this through the theme, so set_theme() can be used to change global defaults.

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

set_theme(
  theme_gray() +
    theme(
      palette.colour.continuous = pal_div_gradient(),
      palette.colour.discrete = palette.colors(7)
    )
)

p <- ggplot(mpg, aes(displ, hwy))
p + geom_point(aes(colour = cty))

p + geom_point(aes(colour = class))

Created on 2024-06-21 with reprex v2.1.0

@hadley
Copy link
Member Author

hadley commented Dec 4, 2024

Maybe it's worth having a theme_grey2() or similar that uses the better palettes? Or make it an option to more of the themes? I would eventually like to make this the default if you use some tidyverse wide edition, a la tidyverse/tidyverse#284.

@teunbrand
Copy link
Collaborator

Thomas and I discussed this to some extent and we plan to put better defaults behind an 'edition 2025' switch, similar in spirit to the testthat 3rd edition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement scales 🐍
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants