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 turn strip clipping off #4118

Closed
teunbrand opened this issue Jul 4, 2020 · 4 comments
Closed

Option to turn strip clipping off #4118

teunbrand opened this issue Jul 4, 2020 · 4 comments
Labels
facets 💎 feature a feature request or enhancement

Comments

@teunbrand
Copy link
Collaborator

teunbrand commented Jul 4, 2020

Hi everyone,

I recently found the need to turn the clipping off, but I can't easily do that without either (1) writing a new facet function that builds strips as I want or (2) edit the strips in the gtable.

I found a similar question here on so.
A while back, there was a move to make clipping more configurable (#2536), but this has not been extended to strips. Also there was an issue with strip clipping (#2772), which turned it on for all strips; however my intention would be to make this configurable from e.g. the theme.

One reason besides turning off label clipping is to make the strips flush with either axis lines, panel backgrounds and panel borders (the latter two when the coord clipping is turned off).

An example of the behaviour I love to see configurable is below. The intersection between the strip and the axis line is not ideal, and the size parameter appears halved for the strip.

library(ggplot2)

ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  facet_wrap(~ drv) +
  theme(
    strip.background = element_rect(colour = "red", size = 5),
    axis.line.y.left = element_line(colour = "blue", size = 5)
  )

Created on 2020-07-04 by the reprex package (v0.3.0)

Thanks for considering!

@teunbrand
Copy link
Collaborator Author

Is this idea fundamentally flawed or would it be OK if I were to draft a PR on this subject and discuss from there?

@clauswilke
Copy link
Member

I don't think it's fundamentally flawed. Could you put together a PR so we can see what would be required?

@teunbrand
Copy link
Collaborator Author

Sure thing!

@stemangiola
Copy link

Thanks for this feature request. Is there an ETA for this feature to be merged?

@hadley hadley closed this as completed in c151942 Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
facets 💎 feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants