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

Could a function to reset all geom defaults back to the initial defaults be provided? #5975

Open
davidhodge931 opened this issue Jul 4, 2024 · 3 comments · May be fixed by #5976
Open

Could a function to reset all geom defaults back to the initial defaults be provided? #5975

davidhodge931 opened this issue Jul 4, 2024 · 3 comments · May be fixed by #5976

Comments

@davidhodge931
Copy link

Thanks for the continual ggplot2 updates!

I was wondering if there could be a function to reset all geom defaults back to the initial defaults? Otherwise, you have to know what the defaults are, or restart once you update something.

Something simple like below would be super helpful.

reset_geom_defaults <- function() {
  ggplot2::update_geom_defaults("area", NULL)
  ggplot2::update_geom_defaults("bar", NULL)
  ggplot2::update_geom_defaults("boxplot", NULL)
  ggplot2::update_geom_defaults("col", NULL)
  ... # etc with all geom's there
}

Maybe this could be something for Tidy Dev Day, as hopefully pretty simple??

An idea (maybe for the future) is that it could also have an argument that would allow users to specify only certain geoms to reset

@teunbrand
Copy link
Collaborator

I can see value in a grand reset of the default aesthetics. I feel that the geoms shouldn't be hardcoded like in the example you give, which makes it somewhat more complicated.

you have to know what the defaults are

This isn't strictly true, but you have to know which geoms one should reset.

However, I don't think the update_geom_defaults() will be the 'preferred way' of interacting with defaults after #5833 gets merged.

@davidhodge931
Copy link
Author

Thanks, @teunbrand

Do you forsee that update_geom_defaults will be continued to be supported?

I find it super useful

@davidhodge931 davidhodge931 changed the title Could a function to reset all geom defaults back to the initial defaults? Could a function to reset all geom defaults back to the initial defaults be provided? Jul 4, 2024
@teunbrand
Copy link
Collaborator

I see no reason for superseding it, so yes I think it'll be around a while.

@teunbrand teunbrand linked a pull request Jul 5, 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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants