Skip to content

Commit 7396a5d

Browse files
authored
Update scale_alpha() examples (#5675)
1 parent c2f2441 commit 7396a5d

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

R/scale-alpha.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@
2121
#' p <- ggplot(mpg, aes(displ, hwy)) +
2222
#' geom_point(aes(alpha = year))
2323
#'
24+
#' # The default range of 0.1-1.0 leaves all data visible
2425
#' p
26+
#'
27+
#' # Include 0 in the range to make data invisible
28+
#' p + scale_alpha(range = c(0, 1))
29+
#'
30+
#' # Changing the title
2531
#' p + scale_alpha("cylinders")
26-
#' p + scale_alpha(range = c(0.4, 0.8))
2732
scale_alpha <- function(name = waiver(), ..., range = c(0.1, 1)) {
2833
continuous_scale("alpha", name = name, palette = pal_rescale(range), ...)
2934
}

man/scale_alpha.Rd

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)