Skip to content

Commit dc6f406

Browse files
committed
Update documentation with bounds example.
1 parent 9bd40d4 commit dc6f406

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

R/geom-density.r

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
#' geom_density(alpha = 0.1) +
3636
#' xlim(55, 70)
3737
#'
38+
#' # Use `bounds` to adjust computation for known data limits
39+
#' big_diamonds <- diamonds[diamonds$carat >= 1, ]
40+
#' ggplot(big_diamonds, aes(carat)) +
41+
#' geom_density(color = 'red') +
42+
#' geom_density(bounds = c(1, Inf), color = 'blue')
43+
#'
3844
#' \donttest{
3945
#' # Stacked density plots: if you want to create a stacked density plot, you
4046
#' # probably want to 'count' (density * n) variable instead of the default

man/geom_density.Rd

Lines changed: 10 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)