diff --git a/NEWS.md b/NEWS.md index 285399407e..28ecb99196 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # ggplot2 (development version) +* geom_sf now accepts shape names (@sierrajohnson, #5808) * Added `gg` class to `labs()` (@phispu, #5553). * Missing values from discrete palettes are no longer translated (@teunbrand, #5929). diff --git a/R/geom-sf.R b/R/geom-sf.R index c6298e4b3a..457b8c272d 100644 --- a/R/geom-sf.R +++ b/R/geom-sf.R @@ -200,6 +200,9 @@ GeomSf <- ggproto("GeomSf", Geom, if (!inherits(coord, "CoordSf")) { cli::cli_abort("{.fn {snake_class(self)}} can only be used with {.fn coord_sf}.") } + if (is.character(data$shape)) { + data$shape <- translate_shape_string(data$shape) + } data <- coord$transform(data, panel_params)