File: guide_axis_stack.Rd

package info (click to toggle)
r-cran-ggplot2 3.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 9,944 kB
  • sloc: sh: 15; makefile: 5
file content (63 lines) | stat: -rw-r--r-- 2,177 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/guide-axis-stack.R
\name{guide_axis_stack}
\alias{guide_axis_stack}
\title{Stacked axis guides}
\usage{
guide_axis_stack(
  first = "axis",
  ...,
  title = waiver(),
  theme = NULL,
  spacing = NULL,
  order = 0,
  position = waiver()
)
}
\arguments{
\item{first}{A position guide given as one of the following:
\itemize{
\item A string, for example \code{"axis"}.
\item A call to a guide function, for example \code{guide_axis()}.
}}

\item{...}{Additional guides to stack given in the same manner as \code{first}.}

\item{title}{A character string or expression indicating a title of guide.
If \code{NULL}, the title is not shown. By default
(\code{\link[=waiver]{waiver()}}), the name of the scale object or the name
specified in \code{\link[=labs]{labs()}} is used for the title.}

\item{theme}{A \code{\link[=theme]{theme}} object to style the guide individually or
differently from the plot's theme settings. The \code{theme} argument in the
guide overrides, and is combined with, the plot's theme.}

\item{spacing}{A \code{\link[=unit]{unit()}} objects that determines how far separate guides are
spaced apart.}

\item{order}{A positive \code{integer} of length 1 that specifies the order of
this guide among multiple guides. This controls in which order guides are
merged if there are multiple guides for the same position. If 0 (default),
the order is determined by a secret algorithm.}

\item{position}{Where this guide should be drawn: one of top, bottom,
left, or right.}
}
\description{
This guide can stack other position guides that represent position scales,
like those created with \link[=scale_x_continuous]{scale_(x|y)_continuous()} and
\link[=scale_x_discrete]{scale_(x|y)_discrete()}.
}
\details{
The \code{first} guide will be placed closest to the panel and any subsequent
guides provided through \code{...} will follow in the given order.
}
\examples{
#' # A standard plot
p <- ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  theme(axis.line = element_line())

# A normal axis first, then a capped axis
p + guides(x = guide_axis_stack("axis", guide_axis(cap = "both")))
}