Skip to content

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

Open
@davidhodge931

Description

@davidhodge931

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"))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions