element_arrow {ggarrow} | R Documentation |
Arrow theme element
Description
Using the theme system, draws arrows in places where
element_line()
are valid theme elements. Note
that the default use of element_arrow()
does not actually draw an arrow
unless one of the arrow_
arguments is set.
Usage
element_arrow(
colour = NULL,
linewidth = NULL,
linewidth_head = NULL,
linewidth_fins = NULL,
stroke_colour = NULL,
stroke_width = NULL,
arrow_head = NULL,
arrow_fins = NULL,
arrow_mid = NULL,
length = NULL,
length_head = NULL,
length_fins = NULL,
length_mid = NULL,
resect = NULL,
resect_head = NULL,
resect_fins = NULL,
justify = NULL,
force_arrow = NULL,
mid_place = NULL,
lineend = NULL,
linejoin = NULL,
linemitre = NULL,
inherit.blank = FALSE
)
Arguments
colour |
The colour of the arrow. |
linewidth , linewidth_head , linewidth_fins |
The width of the arrow shaft
in millimetres. |
stroke_colour |
The colour of the arrow outline. |
stroke_width |
The width of the arrow outlien. |
arrow_head , arrow_fins , arrow_mid |
Arrow
ornament shapes for the arrow head, arrow fins and
middle arrows respectively. Can be one of the following:
* |
length , length_head , length_fins , length_mid |
Determines the size of
the arrow ornaments.
|
resect , resect_head , resect_fins |
A |
justify |
A |
force_arrow |
A |
mid_place |
Sets the location of middle (interior) ornaments when
|
lineend |
A |
linejoin |
A |
linemitre |
A |
inherit.blank |
A |
Value
An <element_arrow>
object that can replace <element_line>
objects
in theme()
.
Examples
# Setting a bunch of arrows all over the theme
ggplot(whirlpool(5), aes(x, y, group = group)) +
geom_path() +
theme(
# Proper arrow with variable width for x-axis line
axis.line.x = element_arrow(
arrow_head = "head_wings", linewidth_head = 2, linewidth_fins = 0
),
# Just a variable width line for the y-axis line
axis.line.y = element_arrow(linewidth_head = 0, linewidth_fins = 5,
lineend = "round"),
# Arrows for the y-axis ticks
axis.ticks.y = element_arrow(arrow_fins = arrow_head_line(angle = 45)),
# Variable width lines for the x-axis ticks
axis.ticks.x = element_arrow(linewidth_head = 3, linewidth_fins = 0),
axis.ticks.length = unit(0.5, 'cm'),
# Arrows for major panel grid
panel.grid.major = element_arrow(
arrow_head = "head_wings", arrow_fins = "fins_feather", length = 10
),
# Shortened lines for the minor panel grid
panel.grid.minor = element_arrow(resect = 20)
)