primitive_labels {legendry} | R Documentation |
Guide primitive: labels
Description
This function constructs a labels guide primitive.
Usage
primitive_labels(
key = NULL,
angle = waiver(),
n.dodge = 1,
check.overlap = FALSE,
theme = NULL,
position = waiver()
)
Arguments
key |
A standard key specification. See more information in the linked topic. |
angle |
A specification for the text angle. Compared to setting the
|
n.dodge |
An positive |
check.overlap |
A |
theme |
A |
position |
A |
Value
A <PrimitiveLabels>
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.text.{x/y}.{position}
an<element_text>
for the display of the labels.
As a legend guide.
-
legend.text
an<element_text>
for the display of the labels.
See Also
Other primitives:
primitive_box()
,
primitive_bracket()
,
primitive_fence()
,
primitive_line()
,
primitive_segments()
,
primitive_spacer()
,
primitive_ticks()
,
primitive_title()
Examples
# A standard plot
p <- ggplot(mpg, aes(displ, hwy)) +
geom_point()
# Adding as secondary guides
p + guides(
x.sec = primitive_labels(),
y.sec = primitive_labels(n.dodge = 2)
)