Joins the points of each group into a closed shape, in data order. Map
group when the data holds several polygons.
geom_polygon(
mapping = NULL,
data = NULL,
color = NULL,
alpha = NULL,
linewidth = NULL,
border = NULL
)A Layer to add with +.
d <- data.frame(x = c(1, 3, 2), y = c(1, 1, 3))
ggnext(d, aes(x, y)) + geom_polygon()
#> <ggnext plot>
#> data: 3 x 2
#> aes: x = x, y = y
#> layers: 1
#> coord: cartesian
#> mode: static