View source: R/primitive-line.R
primitive_line | R Documentation |
This function constructs a line guide primitive.
primitive_line(key = NULL, cap = "none", theme = NULL, position = waiver())
key |
A standard key specification. See more information in the linked topic. |
cap |
A method to cap the axes. One of the following:
|
theme |
A |
position |
A |
A PrimitiveLine
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.line.{x/y}.{position}
an <element_line>
for the line style.
legend.axis.line
an <element_line>
for the
line style.
Other primitives:
primitive_box()
,
primitive_bracket()
,
primitive_fence()
,
primitive_labels()
,
primitive_segments()
,
primitive_spacer()
,
primitive_ticks()
,
primitive_title()
# A standard plot
p <- ggplot(mpg, aes(displ, hwy)) +
geom_point() +
theme(axis.line = element_line())
# Adding as secondary guides
p + guides(
x.sec = primitive_line(),
y.sec = primitive_line(cap = "both")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.