Bends the panel into a circle: the theta axis becomes the angle and
the other axis becomes the radius. This is the engine behind radar
charts (geom_radar()), pie/donut wedges, and circular bar charts.
coord_polar(theta = "x", start = 0, direction = 1, inner = 0)
Arguments
- theta
Which axis maps to angle: "x" (default) or "y".
- start
Angle in radians for the first position; 0 is 12 o'clock.
- direction
1 clockwise (default), -1 counter-clockwise.
- inner
Inner radius as a fraction of the outer radius — use e.g.
0.3 for a donut hole.
Value
A CoordPolar object to add to a plot with +.
Examples
d <- data.frame(g = c("A", "B", "C", "D"), v = c(4, 7, 3, 6))
ggnext(d, aes(g, v)) + geom_col() + coord_polar()
#> <ggnext plot>
#> data: 4 x 2
#> aes: x = g, y = v
#> layers: 1
#> coord: polar
#> mode: static