Skip to content

Commit 2b1387f

Browse files
committed
Tweak stroke example
1 parent 07f138e commit 2b1387f

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

R/geom-point-.r

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@
8282
#' d + geom_point(alpha = 1/20)
8383
#' d + geom_point(alpha = 1/100)
8484
#'
85-
#' # Using shapes with a border
86-
#' p <- ggplot(mtcars, aes(wt, mpg))
87-
#' p + geom_point(shape=21, size=5, colour='black', fill='white', stroke=4)
85+
#' # For shapes that have a border (like 21), you can colour the inside and
86+
#' # outside separately. Use the stroke aesthetic to modify the width of the
87+
#' # border
88+
#' ggplot(mtcars, aes(wt, mpg)) +
89+
#' geom_point(shape = 21, size = 5, colour = "black", fill = "white", stroke = 5)
8890
#'
8991
#' # You can create interesting shapes by layering multiple points of
9092
#' # different sizes

man/geom_point.Rd

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ d + geom_point(alpha = 1/10)
9595
d + geom_point(alpha = 1/20)
9696
d + geom_point(alpha = 1/100)
9797

98-
# Using shapes with a border
99-
p <- ggplot(mtcars, aes(wt, mpg))
100-
p + geom_point(shape=21, size=5, colour='black', fill='white', stroke=4)
98+
# For shapes that have a border (like 21), you can colour the inside and
99+
# outside separately. Use the stroke aesthetic to modify the width of the
100+
# border
101+
ggplot(mtcars, aes(wt, mpg)) +
102+
geom_point(shape = 21, size = 5, colour = "black", fill = "white", stroke = 5)
101103

102104
# You can create interesting shapes by layering multiple points of
103105
# different sizes

0 commit comments

Comments
 (0)