A segment from each point at a given angle and radius — the usual way to draw a vector or wind field.

geom_spoke(
  mapping = NULL,
  data = NULL,
  color = NULL,
  linewidth = NULL,
  alpha = NULL
)

Arguments

mapping, data

Standard layer overrides. Requires x, y, and the angle (radians) and radius columns supplied via xend/yend.

color, linewidth, alpha

Appearance.

Value

A Layer to add with +.

Examples

g <- expand.grid(x = 1:5, y = 1:5)
g$angle <- atan2(g$y - 3, g$x - 3)
g$radius <- 0.4
ggnext(g, aes(x, y, xend = angle, yend = radius)) + geom_spoke()
#> <ggnext plot>
#>   data:  25 x 4
#>   aes:   x = x, y = y, xend = angle, yend = radius
#>   layers: 1 
#>   coord: cartesian
#>   mode:  static