Skip to content
Open
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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

### Bug fixes

* Logical values for the linetype aesthetic will be interpreted numerically,
so that `linetype = FALSE` becomes 0/'blank' and `linetype = TRUE` becomes
1/'solid' (@teunbrand, #6641)
* Fixed regression where `draw_key_rect()` stopped using `fill` colours
(@mitchelloharawild, #6609).
* Fixed regression where `scale_{x,y}_*()` threw an error when an expression
Expand Down
3 changes: 2 additions & 1 deletion R/geom-violin.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
#' @param quantile.colour,quantile.color,quantile.linewidth,quantile.linetype
#' Default aesthetics for the quantile lines. Set to `NULL` to inherit from
#' the data's aesthetics. By default, quantile lines are hidden and can be
#' turned on by changing `quantile.linetype`.
#' turned on by changing `quantile.linetype`. Quantile values can be set
#' using the `quantiles` argument when using `stat = "ydensity"` (default).
#' @param draw_quantiles `r lifecycle::badge("deprecated")` Previous
#' specification of drawing quantiles.
#' @export
Expand Down
7 changes: 5 additions & 2 deletions R/stat-ydensity.R
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,11 @@ StatYdensity <- ggproto(
#' @param drop Whether to discard groups with less than 2 observations
#' (`TRUE`, default) or keep such groups for position adjustment purposes
#' (`FALSE`).
#' @param quantiles If not `NULL` (default), compute the `quantile` variable
#' and draw horizontal lines at the given quantiles in `geom_violin()`.
#' @param quantiles A numeric vector with numbers between 0 and 1 to indicate
#' quantiles marked by the `quantile` computed variable. The default marks the
#' 25th, 50th and 75th percentiles. The display of quantiles can be
#' turned on by setting `quantile.linetype` to non-blank when using
#' `geom = "violin"` (default).
#'
#' @eval rd_computed_vars(
#' density = "Density estimate.",
Expand Down
9 changes: 7 additions & 2 deletions R/utilities-grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ gg_par <- function(..., stroke = NULL, pointsize = NULL) {
stroke[is.na(stroke)] <- 0
args$fontsize <- pointsize * .pt + stroke * .stroke / 2
}
if (!is.null(args$lty) && anyNA(args$lty)) {
args$lty[is.na(args$lty)] <- if (is.character(args$lty)) "blank" else 0
if (!is.null(args$lty)) {
if (is.logical(args$lty)) {
args$lty <- as.integer(args$lty)
}
if (anyNA(args$lty)) {
args$lty[is.na(args$lty)] <- if (is.character(args$lty)) "blank" else 0
}
}

inject(gpar(!!!args))
Expand Down
10 changes: 7 additions & 3 deletions man/geom_violin.Rd

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

Loading