Skip to content

Commit ee5c9e5

Browse files
Add translate_string_shape to GeomSf (#6039)
1 parent 308d4c3 commit ee5c9e5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ggplot2 (development version)
22

3+
* geom_sf now accepts shape names (@sierrajohnson, #5808)
34
* Added `gg` class to `labs()` (@phispu, #5553).
45
* Missing values from discrete palettes are no longer translated
56
(@teunbrand, #5929).

R/geom-sf.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ GeomSf <- ggproto("GeomSf", Geom,
200200
if (!inherits(coord, "CoordSf")) {
201201
cli::cli_abort("{.fn {snake_class(self)}} can only be used with {.fn coord_sf}.")
202202
}
203+
if (is.character(data$shape)) {
204+
data$shape <- translate_shape_string(data$shape)
205+
}
203206

204207
data <- coord$transform(data, panel_params)
205208

0 commit comments

Comments
 (0)