Closed
Description
You'd expect a gradient in the plot below:
library(ggplot2)
grad <- grid::linearGradient(c("red", "black"))
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
ggplot(nc) +
geom_sf(fill = grad)
#> Error in `geom_sf()`:
#> ! Problem while converting geom to grob.
#> ℹ Error occurred in the 1st layer.
#> Caused by error:
#> ! Unknown colour name: list(x1 = 0, y1 = 0, x2 = 1, y2 = 1, stops = c(0, 1), colours = c("red", "black"), extend = "pad", group = TRUE)
Created on 2024-02-27 with reprex v2.1.0
Metadata
Metadata
Assignees
Labels
No labels