-
Notifications
You must be signed in to change notification settings - Fork 2.1k
add an "outside" argument to geom_rug() to allow for moving rug tasse… #3085
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
Conversation
…ls to outside the plot area
Can I get you to run |
library(ggplot2)
# current behaviour with tassels inside figure area
ggplot(airquality,
aes(x = Ozone,
y = Solar.R)) +
geom_rug() # move the tassels outside, remembering to turn off clipping
ggplot(airquality,
aes(x = Ozone,
y = Solar.R)) +
geom_rug(outside = TRUE) +
coord_cartesian(clip = "off") # move the tassels to top right side, and expand margin
ggplot(airquality,
aes(x = Ozone,
y = Solar.R)) +
geom_rug(outside = TRUE,
sides = "tr") +
coord_cartesian(clip = "off") +
theme(plot.margin = margin(1,1,1,1, "cm")) Created on 2019-01-19 by the reprex package (v0.2.1) |
Here's a reprex to demonstrate the behaviour: library(ggplot2)
# current behaviour with tassels inside figure area
ggplot(airquality,
aes(x = Ozone,
y = Solar.R)) +
geom_rug() # move the tassels outside, remembering to turn off clipping
ggplot(airquality,
aes(x = Ozone,
y = Solar.R)) +
geom_rug(outside = TRUE) +
coord_cartesian(clip = "off") # move the tassels to top right side, and expand margin
ggplot(airquality,
aes(x = Ozone,
y = Solar.R)) +
geom_rug(outside = TRUE,
sides = "tr") +
coord_cartesian(clip = "off") +
theme(plot.margin = margin(1,1,1,1, "cm")) Created on 2019-01-19 by the reprex package (v0.2.1) |
@njtierney If you're up for another PR I think it would be worth adding a test for this new behavior. |
@karawoo - great idea! I'll get cracking on that now. :) |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
…ls to outside the plot area