Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions R/geom-ribbon.r
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@
#' h +
#' geom_ribbon(aes(ymin = level - 1, ymax = level + 1), fill = "grey70") +
#' geom_line(aes(y = level))
#'
#' # The underlying stat_align() takes care of unaligned data points
#' df <- data.frame(
#' g = c("a", "a", "a", "b", "b", "b"),
#' x = c(1, 3, 5, 2, 4, 6),
#' y = c(2, 5, 1, 3, 6, 7)
#' )
#' a <- ggplot(df, aes(x, y, fill = g)) +
#' geom_area()
#'
#' # Two groups have points on different X values.
#' a + geom_point(size = 8) + facet_grid(g ~ .)
#'
#' # stat_align() interpolates and aligns the value so that the areas can stack
#' # properly.
#' a + geom_point(stat = "align", position = "stack", size = 8)
geom_ribbon <- function(mapping = NULL, data = NULL,
stat = "identity", position = "identity",
...,
Expand Down
16 changes: 16 additions & 0 deletions man/geom_ribbon.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.