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

Feature request add strip.background.y and strip.background.x ? #2249

Closed
smouksassi opened this issue Aug 25, 2017 · 1 comment
Closed

Feature request add strip.background.y and strip.background.x ? #2249

smouksassi opened this issue Aug 25, 2017 · 1 comment

Comments

@smouksassi
Copy link

@smouksassi smouksassi commented Aug 25, 2017

With the switch argument and strip placement one might want to color the x and y facets differently e.g. below there is no way to keep the y facets gray while coloring the x ones white

ggplot(mtcars, aes(cyl,disp))+
facet_grid(vs~am,switch="x")+
theme(strip.placement="outside",
strip.background=element_rect(fill="gray"))
@hadley
Copy link
Member

@hadley hadley commented Nov 8, 2017

Pretend reprex:

df <- data.frame(x = 1:2, y = 1:2)
ggplot(df, aes(x, y)) +
  facet_grid(x ~ y) +
  theme(
    strip.background.x = element_rect(fill = "red"),
    strip.background.y = element_rect(fill = "green")
  )

@hadley hadley closed this in c6cc383 Nov 8, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants