This function constructs a spacer guide primitive. The spacer is intended for use in guide composition.
Arguments
- space
A [
<unit[1]>][grid::unit()]- title
One of the following to indicate the title of the guide:
- theme
A
<theme>object to style the guide individually or differently from the plot's theme settings. Thethemeargument in the guide overrides and is combined with the plot's theme.- position
A
<character[1]>giving the location of the guide. Can be one of"top","bottom","left"or"right".
Details
Styling options
Below are the 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.
| Theme setting | Context | Type | Description |
legendry.guide.spacing | Any | unit() | Fallback amount of spacing when the space argument is NULL |
There are no other styling options.
The context-agnostic alternative to using theme() is to use
theme_guide():
primitive_spacer(theme = theme_guide(
spacing = unit(5, "mm"),
))Examples
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
guides(
x = guide_axis_stack("axis", primitive_spacer(unit(1, "cm")), "axis")
)
