Arguments
- key
A standard key specification. The key is shared among all guides that have
NULLkeys themselves. See more information in the linked topic.- middle
Guide to use as the middle guide. Each guide can be specified as one of the following:
A
<Guide>class object.A
<function>that returns a<Guide>class object.A
<character>naming such a function, without theguide_orprimitive_prefix.
- text, opposite
Guides to use at the
legend.text.positionlocation and on the opposite side of themiddleguide respectively. Guide specification is the same as in themiddleargument.- args
A
<list>of arguments to pass to guides that are given either as a function or as a string.- suppress_labels
A
<character>vector giving any of"text"and"opposite"for the parallel guides. The guide(s) listed here will not draw labels if they support a label suppression mechanism.- complete
A
<logical[1]>whether to treat the composition as a complete guide. IfTRUE, a title and margin are added to the result. IfFALSE(default), no titles and margins are added.- theme
A
<theme>object to style the guide individually of differently from the plot's theme settings. Thethemearguments in the guide overrides, and is combined with, the plot's theme.- theme_defaults
A
<list>of theme elements to override undeclared theme arguments.- reverse
A
<logical[1]>whether to reverse continuous guides. IfTRUE, guides like colour bars are flipped. IfFALSE(default), the original order is maintained.- order
A positive
<integer[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. If0(default), the order is determined by a hashing indicative settings of a guide.- title
One of the following to indicate the title of the guide:
- position
Where this guide should be drawn: one of
"top","bottom","left", or"right".- available_aes
A
<character>vector listing the aesthetics for which this guide can be build.
Details
The sandwich composition is effectively the same as a crux composition lacking two opposing arms.
See also
Other composition:
compose_crux(),
compose_ontop(),
compose_stack(),
guide-composition
Examples
# A standard plot with a sandwich guide
ggplot(mpg, aes(displ, hwy)) +
geom_point(aes(colour = cty)) +
guides(colour = compose_sandwich(
middle = "colourbar",
text = "axis_base",
opposite = primitive_bracket(key = key_range_manual(
start = c(10, 20), end = c(25, 30), name = c("A", "B")
))
))
