You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/geom-rug.r
+26-5Lines changed: 26 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@
14
14
#' @param sides A string that controls which sides of the plot the rugs appear on.
15
15
#' It can be set to a string containing any of `"trbl"`, for top, right,
16
16
#' bottom, and left.
17
+
#' @param outside logical that controls whether to move the rug tassels outside of the plot area. Default is off (FALSE). You will also need to use `coord_cartesian(clip = "off")`. When set to TRUE, also consider changing the sides argument to "tr". See examples.
17
18
#' @export
18
19
#' @examples
19
20
#' p <- ggplot(mtcars, aes(wt, mpg)) +
@@ -31,9 +32,21 @@
31
32
#' ggplot(mpg, aes(displ, cty)) +
32
33
#' geom_jitter() +
33
34
#' geom_rug(alpha = 1/2, position = "jitter")
35
+
#'
36
+
#' # move the rug tassels to outside the plot
37
+
#' # remember to set clip = "off".
38
+
#' p + geom_rug(outside = TRUE) +
39
+
#' coord_cartesian(clip = "off")
40
+
#'
41
+
#' # set sides to top right, and then move the margins
0 commit comments