You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @grantmcdermott, @vincentarelbundock and @zeileis, I'm just wondering whether support for sf objects is on the roadmap. ggplot2 can be quite slow when drawing maps with several elements (say all the US counties + fill by variable + points). To clarify, creating the map is not slow but printing it can easily take 15-20 seconds or more and I'm wondering if a base plot would be faster for this.
A complete support would probably be complicated, but here's a very simple example:
library(ggplot2)
library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.3.1; sf_use_s2() is TRUEnc<-sf::st_read(system.file("shape/nc.shp", package="sf"), quiet=TRUE)
ggplot(nc) +
geom_sf(aes(fill=AREA))
nc[, "AREA", drop=FALSE] |>
plot()
Being able to do plt(~ AREA, fill = "by", type = "map") would be great (contrarily to the syntax for density plots, we'd only need to have one variable in the formula here).
The text was updated successfully, but these errors were encountered:
etiennebacher
changed the title
Support for sf objects for maps?
Support sf objects for maps?
Aug 30, 2024
Native sf support is something I'd love to support. See #159 (comment) for a proof of concept.
One annoyance we'd have to figure out is color scaling for continuous grouping variables, since polypaths aren't currently compatible with our gradient legend logic. I have an idea for a workaround, but won't have time to look into this properly for the next few weeks.
Hi @grantmcdermott, @vincentarelbundock and @zeileis, I'm just wondering whether support for
sf
objects is on the roadmap.ggplot2
can be quite slow when drawing maps with several elements (say all the US counties + fill by variable + points). To clarify, creating the map is not slow but printing it can easily take 15-20 seconds or more and I'm wondering if a base plot would be faster for this.A complete support would probably be complicated, but here's a very simple example:
Being able to do
plt(~ AREA, fill = "by", type = "map")
would be great (contrarily to the syntax for density plots, we'd only need to have one variable in the formula here).The text was updated successfully, but these errors were encountered: