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

In facet_grid, could the switch argument be deprecated, and replaced with a strip.position argument? #5999

Open
davidhodge931 opened this issue Jul 12, 2024 · 2 comments · May be fixed by #6161

Comments

@davidhodge931
Copy link

davidhodge931 commented Jul 12, 2024

I find it a bit confusing having the strip.position/switch argument in facet_wrap/facet_grid that does pretty much the same thing.

An idea to make these consistent is to deprecate the switch argument in facet_grid, and add in a strip.position argument for users to use instead.

Where in a grid of 2 facet variables, a character vector of 2 could be provided with "top"/"bottom" always controlling the x, and "left"/"right" would always controlling the y.

Also, It'd be cool if for the grid, it didn't matter which way around you specify the vector - as it would always know top/bottom relates to cols facet variable and right/left to the rows facet variable.

penguins |> 
   ggplot() +
   geom_point(aes(x = flipper_length_mm, y = body_mass_g)) +
   facet_grid(.~species, strip.position = "bottom")
 
 penguins |> 
   ggplot() +
   geom_point(aes(x = flipper_length_mm, y = body_mass_g)) +
   facet_grid(sex~species, strip.position = c("bottom", "left"))
@davidhodge931 davidhodge931 changed the title In facet_grid, could the switch argument be deprecated, and replaced with a strip.position argument? In facet_grid, could the switch argument be deprecated, and replaced with a strip.position argument? Jul 12, 2024
@teunbrand
Copy link
Collaborator

I empathise with the consistency argument, but I don't think the current sistuation is creating enough friction to justify the trouble of changing this argument.

@davidhodge931
Copy link
Author

It'd also be good to get consistency now, before there is many extension facet functions - so that when developers make these they all use the same named argument to represent this concept.

Feel free to close if you're still are not persuaded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants