Skip to contents

Draws directional arrows from Cartesian coordinates and an angle.

Usage

geom_direction_arrow(
  mapping = NULL,
  data = NULL,
  ...,
  length = 1,
  arrow_length = grid::unit(0.15, "cm"),
  angle_convention = c("mathematical", "bearing"),
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE
)

Arguments

mapping, data, show.legend, inherit.aes

Standard ggplot2 layer arguments.

...

Additional arguments passed to ggplot2::geom_segment().

length

Default arrow length when no length aesthetic is supplied.

arrow_length

Grid unit controlling the arrow head length.

angle_convention

Angle convention. "mathematical" means zero is east and angles increase counterclockwise. "bearing" means zero is north and angles increase clockwise.

na.rm

Should missing values be silently removed?

Value

A ggplot2 layer.

Examples

ggplot2::ggplot(animal_steps, ggplot2::aes(x = x, y = y, angle = bearing)) +
  geom_direction_arrow()
#> Warning: Removed 3 rows containing non-finite outside the scale range
#> (`stat_direction_arrow()`).