primitive_title {legendry} | R Documentation |
Guide primitive: title
Description
This function constructs a title guide primitive.
Usage
primitive_title(
title = waiver(),
angle = waiver(),
theme = NULL,
position = waiver()
)
Arguments
title |
A |
angle |
A specification for the text angle. Compared to setting the
|
theme |
A |
position |
A |
Value
A <PrimitiveTitle>
primitive guide that can be used inside other
guides.
Styling options
Below are the theme options that determine the styling of this guide, which may differ depending on whether the guide is used in an axis or in a legend context.
As an axis guide
-
axis.title.{x/y}.{position}
an<element_text>
for the title display.
As a legend guide
-
legend.title
an<element_text>
for the title display.
See Also
Other primitives:
primitive_box()
,
primitive_bracket()
,
primitive_fence()
,
primitive_labels()
,
primitive_line()
,
primitive_segments()
,
primitive_spacer()
,
primitive_ticks()
Examples
# A standard plot
p <- ggplot(mpg, aes(displ, hwy)) +
geom_point()
# Adding as secondary guides
p + guides(
x.sec = primitive_title("Horizontal Title"),
y.sec = primitive_title(c("along vertical", "Multiple tiles"))
)