primitive_line {legendry} | R Documentation |
Guide primitive: line
Description
This function constructs a line guide primitive.
Usage
primitive_line(key = NULL, cap = "none", theme = NULL, position = waiver())
Arguments
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 |
Value
A PrimitiveLine
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.line.{x/y}.{position}
an<element_line>
for the line style.
As a legend guide
-
legend.axis.line
an<element_line>
for the line style.
See Also
Other primitives:
primitive_box()
,
primitive_bracket()
,
primitive_fence()
,
primitive_labels()
,
primitive_segments()
,
primitive_spacer()
,
primitive_ticks()
,
primitive_title()
Examples
# 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")
)