tidyverse/ggplot2

`geom_sf` still not processing shape aesthetics when passed as strings

Closed this issue · 1 comments

The issue raised in #5808 (and apparently fixed) is still not working for me.
I have the latest ggplot2 from CRAN (v3.5.2) which should have the fix in it.

Here's my reprex:

nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE) |>
  sf::st_centroid() |>
  suppressWarnings()

ggplot2::ggplot(nc) +
  ggplot2::geom_sf(shape = "diamond filled", size = 8)

ggplot2::ggplot(nc) +
  ggplot2::geom_sf(
    shape = ggplot2:::translate_shape_string("diamond filled"),
    size = 8,
    fill = "grey50"
  )

sessioninfo::package_info("ggplot2", dependencies = FALSE)
#>  package * version date (UTC) lib source
#>  ggplot2   3.5.2   2025-04-09 [1] CRAN (R 4.5.0)

Created on 2025-09-10 with reprex v2.1.1

The fix is forthcoming in ggplot2 4.0.0, which hopefully releases soon.
The news bullet is under the development version header:

ggplot2/NEWS.md

Line 313 in bed8e32

* `geom_sf()` now accepts shape names for point geometries (@sierrajohnson, #5808)