1% Generated by roxygen2: do not edit by hand
2% Please edit documentation in R/guides-axis.r
3\name{guide_axis}
4\alias{guide_axis}
5\title{Axis guide}
6\usage{
7guide_axis(
8  title = waiver(),
9  check.overlap = FALSE,
10  angle = NULL,
11  n.dodge = 1,
12  order = 0,
13  position = waiver()
14)
15}
16\arguments{
17\item{title}{A character string or expression indicating a title of guide.
18If \code{NULL}, the title is not shown. By default
19(\code{\link[=waiver]{waiver()}}), the name of the scale object or the name
20specified in \code{\link[=labs]{labs()}} is used for the title.}
21
22\item{check.overlap}{silently remove overlapping labels,
23(recursively) prioritizing the first, last, and middle labels.}
24
25\item{angle}{Compared to setting the angle in \code{\link[=theme]{theme()}} / \code{\link[=element_text]{element_text()}},
26this also uses some heuristics to automatically pick the \code{hjust} and \code{vjust} that
27you probably want.}
28
29\item{n.dodge}{The number of rows (for vertical axes) or columns (for
30horizontal axes) that should be used to render the labels. This is
31useful for displaying labels that would otherwise overlap.}
32
33\item{order}{Used to determine the order of the guides (left-to-right,
34top-to-bottom), if more than one  guide must be drawn at the same location.}
35
36\item{position}{Where this guide should be drawn: one of top, bottom,
37left, or right.}
38}
39\description{
40Axis guides are the visual representation of position scales like those
41created with \link[=scale_x_continuous]{scale_(x|y)_continuous()} and
42\link[=scale_x_discrete]{scale_(x|y)_discrete()}.
43}
44\examples{
45# plot with overlapping text
46p <- ggplot(mpg, aes(cty * 100, hwy * 100)) +
47  geom_point() +
48  facet_wrap(vars(class))
49
50# axis guides can be customized in the scale_* functions or
51# using guides()
52p + scale_x_continuous(guide = guide_axis(n.dodge = 2))
53p + guides(x = guide_axis(angle = 90))
54
55# can also be used to add a duplicate guide
56p + guides(x = guide_axis(n.dodge = 2), y.sec = guide_axis())
57
58
59}
60