Skip to content

Commit 81ffdd0

Browse files
improve documentation for xlim and ylim in limits.r (#3768)
* improve documentation for xlim and ylim in limits.r
1 parent 214f314 commit 81ffdd0

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

R/limits.r

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,19 @@
44
#' individual scales. Note that, by default, any values outside the limits
55
#' will be replaced with `NA`.
66
#'
7-
#' @param ... A name-value pair. The name must be an aesthetic, and the value
8-
#' must be either a length-2 numeric, a character, a factor, or a date/time.
7+
#' @param ... For `xlim()` and `ylim()`: Two numeric values, specifying the left/lower
8+
#' limit and the right/upper limit of the scale. If the larger value is given first,
9+
#' the scale will be reversed. You can leave one value as `NA` if you want to compute
10+
#' the corresponding limit from the range of the data.
11+
#'
12+
#' For `lims()`: A name--value pair. The name must be an aesthetic, and the value
13+
#' must be either a length-2 numeric, a character, a factor, or a date/time.
14+
#' A numeric value will create a continuous scale. If the larger value comes first,
15+
#' the scale will be reversed. You can leave one value as `NA` if you want
16+
#' to compute the corresponding limit from the range of the data.
17+
#' A character or factor value will create a discrete scale.
18+
#' A date-time value will create a continuous date/time scale.
919
#'
10-
#' A numeric value will create a continuous scale. If the larger value
11-
#' comes first, the scale will be reversed. You can leave one value as
12-
#' `NA` to compute from the range of the data.
13-
#'
14-
#' A character or factor value will create a discrete scale.
15-
#'
16-
#' A date-time value will create a continuous date/time scale.
1720
#' @seealso For changing x or y axis limits \strong{without} dropping data
1821
#' observations, see [coord_cartesian()]. To expand the range of
1922
#' a plot to always include certain values, see [expand_limits()]. For other

man/lims.Rd

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

0 commit comments

Comments
 (0)