This is a polar parameterisation of
geom_segment(). It is
useful when you have variables that describe direction and distance.
The angles start from east and increase counterclockwise.
geom_spoke( mapping = NULL, data = NULL, stat = "identity", position = "identity", ..., na.rm = FALSE, show.legend = NA, inherit.aes = TRUE )
Set of aesthetic mappings created by
The data to be displayed in this layer. There are three options:
The statistical transformation to use on the data for this layer, as a string.
Position adjustment, either as a string, or the result of a call to a position adjustment function.
Other arguments passed on to
logical. Should this layer be included in the legends?
geom_spoke() understands the following aesthetics (required aesthetics are in bold):
Learn more about setting these aesthetics in
df <- expand.grid(x = 1:10, y=1:10) df$angle <- runif(100, 0, 2*pi) df$speed <- runif(100, 0, sqrt(0.1 * df$x)) ggplot(df, aes(x, y)) + geom_point() + geom_spoke(aes(angle = angle), radius = 0.5)