View source: R/primitive-labels.R
primitive_labels | R Documentation |
This function constructs a labels guide primitive.
primitive_labels(
key = NULL,
angle = waiver(),
n.dodge = 1,
check.overlap = FALSE,
theme = NULL,
position = waiver()
)
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 |
A <PrimitiveLabels>
primitive guide that can be used inside other
guides.
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.
axis.text.{x/y}.{position}
an <element_text>
for the display of the labels.
legend.text
an <element_text>
for the display
of the labels.
Other primitives:
primitive_box()
,
primitive_bracket()
,
primitive_fence()
,
primitive_line()
,
primitive_segments()
,
primitive_spacer()
,
primitive_ticks()
,
primitive_title()
# 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)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.