Skip to content

Commit 9528e52

Browse files
committed
Better parity with continuous limits
1 parent ad8e6c7 commit 9528e52

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

R/scale-discrete-.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
#' @param continuous.limits One of:
2020
#' * `NULL` to use the default scale range
2121
#' * A numeric vector of length two providing a display range for the scale.
22-
#' * A function that accepts the existing continuous limits and returns a
23-
#' numeric vector of length two.
22+
#' Use `NA` to refer to the existing minimum or maximum.
23+
#' * A function that accepts the limits and returns a numeric vector of
24+
#' length two.
2425
#' @rdname scale_discrete
2526
#' @family position scales
2627
#' @seealso

R/scale-expansion.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,7 @@ expand_limits_discrete <- function(limits, expand = expansion(0, 0), coord_limit
180180
check_numeric(continuous_limits, arg = "continuous.limits")
181181
check_length(continuous_limits, 2L, arg = "continuous.limits")
182182
missing <- is.na(continuous_limits)
183-
limits <- range(ifelse(missing, limits, continuous_limits))
184-
coord_limits <- range(ifelse(missing, coord_limits, continuous_limits))
183+
limits <- ifelse(missing, range(limits), continuous_limits)
185184
}
186185

187186
limit_info <- expand_limits_discrete_trans(

man/scale_discrete.Rd

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)