File: xylim.Rd

package info (click to toggle)
r-cran-ggplot2 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,412 kB
  • sloc: sh: 9; makefile: 1
file content (42 lines) | stat: -rw-r--r-- 1,010 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
% Generated by roxygen2 (4.0.1): do not edit by hand
\name{xlim}
\alias{xlim}
\alias{ylim}
\title{Convenience functions to set the limits of the x and y axis.}
\usage{
xlim(...)

ylim(...)
}
\arguments{
\item{...}{if numeric, will create a continuous scale, if factor or
character, will create a discrete scale.}
}
\description{
Observations not in this range will be dropped completely and
not passed to any other layers.  If a NA value is substituted for one of the
limits that limit is automatically calculated.
}
\examples{
# xlim
xlim(15, 20)
xlim(20, 15)
xlim(c(10, 20))
xlim("a", "b", "c")
qplot(mpg, wt, data=mtcars) + xlim(15, 20)
# with automatic lower limit
qplot(mpg, wt, data=mtcars) + xlim(NA, 20)

# ylim
ylim(15, 20)
ylim(c(10, 20))
ylim("a", "b", "c")
qplot(mpg, wt, data=mtcars) + ylim(0, 4)
# with automatic upper limit
qplot(mpg, wt, data=mtcars) + ylim(0, NA)
}
\seealso{
For changing x or y axis limits \strong{without} dropping data
  observations, see \code{\link{coord_cartesian}}.
}