% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/primitive-spacer.R
\name{primitive_spacer}
\alias{primitive_spacer}
\title{Guide primitive: spacer}
\usage{
primitive_spacer(
  space = NULL,
  title = waiver(),
  theme = NULL,
  position = waiver()
)
}
\arguments{
\item{space}{A [\verb{<unit[1]>}][grid::unit()]}

\item{title}{One of the following to indicate the title of the guide:
\itemize{
\item A \verb{<character[1]>} or \verb{<expression[1]>} to set a custom title.
\item \code{NULL} to not display any title.
\item \code{\link[ggplot2:waiver]{waiver()}} (default) to take the name of the scale
object or the name specified in \code{\link[ggplot2:labs]{labs()}} as the title.
}}

\item{theme}{A \code{\link[ggplot2: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{position}{A \verb{<character[1]>} giving the location of the guide. Can be one of \code{"top"},
\code{"bottom"}, \code{"left"} or \code{"right"}.}
}
\value{
A \verb{<PrimitiveSpacer>} primitive guide that can be used inside
other guides.
}
\description{
This function constructs a spacer \link[=guide-primitives]{guide primitive}.
The spacer is intended for use in \link[=guide-composition]{guide composition}.
}
\details{
\subsection{Styling options}{

Below are the \link[ggplot2:theme]{theme} options that determine the styling of
this guide. In context to many primitive guides, whether it is used in an
axis or legend has no bearing on the style.\tabular{llll}{
   \strong{Theme setting} \tab \strong{Context} \tab \strong{Type} \tab \strong{Description} \cr
   \code{legendry.guide.spacing} \tab Any \tab \code{\link[=unit]{unit()}} \tab Fallback amount of spacing when the \code{space} argument is \code{NULL} \cr
}


There are no other styling options.
The context-agnostic alternative to using \code{theme()} is to use
\code{\link[=theme_guide]{theme_guide()}}:

\if{html}{\out{<div class="sourceCode r">}}\preformatted{primitive_spacer(theme = theme_guide(
  spacing = unit(5, "mm"),
))
}\if{html}{\out{</div>}}
}
}
\examples{
ggplot(mpg, aes(displ, hwy)) +
  geom_point() +
  guides(
    x = guide_axis_stack("axis", primitive_spacer(unit(1, "cm")), "axis")
  )
}
\seealso{
Other primitives:
\code{\link[=primitive_box]{primitive_box()}},
\code{\link[=primitive_bracket]{primitive_bracket()}},
\code{\link[=primitive_fence]{primitive_fence()}},
\code{\link[=primitive_labels]{primitive_labels()}},
\code{\link[=primitive_line]{primitive_line()}},
\code{\link[=primitive_segments]{primitive_segments()}},
\code{\link[=primitive_ticks]{primitive_ticks()}},
\code{\link[=primitive_title]{primitive_title()}}
}
\concept{primitives}
