Skip to content

Set outline type for geom_density as geom_area #3708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion R/geom-density.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' See [geom_violin()] for a compact density display.
#' @inheritParams layer
#' @inheritParams geom_bar
#' @inheritParams geom_ribbon
#' @param geom,stat Use to override the default connection between
#' `geom_density` and `stat_density`.
#' @export
Expand Down Expand Up @@ -56,7 +57,9 @@ geom_density <- function(mapping = NULL, data = NULL,
na.rm = FALSE,
orientation = NA,
show.legend = NA,
inherit.aes = TRUE) {
inherit.aes = TRUE,
outline.type = 'upper') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
outline.type = 'upper') {
outline.type = "upper") {

outline.type <- match.arg(outline.type, c("both", "upper", "lower", "legacy"))

layer(
data = data,
Expand All @@ -69,6 +72,7 @@ geom_density <- function(mapping = NULL, data = NULL,
params = list(
na.rm = na.rm,
orientation = orientation,
outline.type = outline.type,
...
)
)
Expand Down
7 changes: 6 additions & 1 deletion man/geom_density.Rd

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