Closed
Description
When usingcoord_sf()
to change the projection of a map, the background layer produced by annotation_map()
is not getting reprojected.
First, a plot without changing projection, using the annotation_map layer to give more context to North Carolina
library(ggplot2)
library(sf)
nc <- sf::st_read(system.file("shape/nc.shp", package = "sf"), quiet = TRUE)
ggplot() +
annotation_map(map_data("state"),fill="antiquewhite",colour="darkgrey")+
geom_sf(data = nc)
However, changing the projection looses the annotation layer, but reprojects the geometry layer
ggplot() +
annotation_map(map_data("state"),fill="antiquewhite",colour="darkgrey")+
geom_sf(data = nc)+
coord_sf(crs = st_crs(3347))
It looks to me like the annotation_layer is not being reprojected.