Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geom_sf() does not accept patterns #5716

Closed
teunbrand opened this issue Feb 27, 2024 · 0 comments · Fixed by #5717
Closed

geom_sf() does not accept patterns #5716

teunbrand opened this issue Feb 27, 2024 · 0 comments · Fixed by #5717

Comments

@teunbrand
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant