R/geom-spoke.r
geom_spoke.Rd
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 )
mapping | Set of aesthetic mappings created by |
---|---|
data | The data to be displayed in this layer. There are three options: If A A |
stat | The statistical transformation to use on the data for this layer, as a string. |
position | Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... | Other arguments passed on to |
na.rm | If |
show.legend | logical. Should this layer be included in the legends?
|
inherit.aes | If |
geom_spoke()
understands the following aesthetics (required aesthetics are in bold):
x
y
angle
radius
alpha
colour
group
linetype
size
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
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)