From d6aca63396b6eca139672aa1caed7fbd5a8965bf Mon Sep 17 00:00:00 2001 From: Sierra Johnson Date: Thu, 15 Aug 2024 12:03:02 -0700 Subject: [PATCH 1/2] Add translate_string_shape to GeomSf. Fixes #5808 --- R/geom-sf.R | 3 +++ 1 file changed, 3 insertions(+) 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) From d74642a81ec7fc86d1f9c5abeeb62935d702080c Mon Sep 17 00:00:00 2001 From: Sierra Johnson Date: Thu, 15 Aug 2024 15:13:43 -0700 Subject: [PATCH 2/2] news update --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 4c0ea1e891..4674d50c98 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # ggplot2 (development version) +* geom_sf now accepts shape names (@sierrajohnson, #5808) * Missing values from discrete palettes are no longer translated (@teunbrand, #5929). * Fixed bug in `facet_grid(margins = TRUE)` when using expresssions