Skip to content

geom_sf() does not accept patterns #5716

Closed
@teunbrand

Description

@teunbrand

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions