Skip to content

Commit 020c9eb

Browse files
authored
Merge pull request #5135 from teunbrand/area_examples
Mention `stat = "identity"` in `geom_area()` docs
2 parents 08fb7d5 + ebc3fbc commit 020c9eb

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

R/geom-ribbon.r

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
#' whole varies over the range of x. Choosing the order in which different
1111
#' components is stacked is very important, as it becomes increasing hard to
1212
#' see the individual pattern as you move up the stack. See
13-
#' [position_stack()] for the details of stacking algorithm.
13+
#' [position_stack()] for the details of stacking algorithm. To facilitate
14+
#' stacking, the default `stat = "align"` interpolates groups to a common set
15+
#' of x-coordinates. To turn off this interpolation, `stat = "identity"` can
16+
#' be used instead.
1417
#'
1518
#' @eval rd_orientation()
1619
#'
@@ -57,6 +60,10 @@
5760
#' # stat_align() interpolates and aligns the value so that the areas can stack
5861
#' # properly.
5962
#' a + geom_point(stat = "align", position = "stack", size = 8)
63+
#'
64+
#' # To turn off the alignment, the stat can be set to "identity"
65+
#' ggplot(df, aes(x, y, fill = g)) +
66+
#' geom_area(stat = "identity")
6067
geom_ribbon <- function(mapping = NULL, data = NULL,
6168
stat = "identity", position = "identity",
6269
...,

man/geom_ribbon.Rd

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