Open hughjonesd opened 1 year ago
I seem to meet the same problem when trying to enlarge an area of a map using sf package:
# no magnify and warning either
ocean_map <- rnaturalearth::ne_coastline(scale = 'large', returnclass = c("sf"))
p <- ggplot() +
geom_sf(data = ocean_map, aes(geometry = geometry)) +
theme_bw() +
geom_magnify(from = c(-20, 30, 37, 60), to = c(40, 120, 27, 70), shape = "outline")
p
Fixing this will add a lot of complexity, I think. A workaround is simply to add your data to the geom_magnify()
call:
ggplot() +
geom_point(data = blah, ...) +
geom_magnify(data = blah, from = ..., to = ...)
It solved my problem perfectly. Thank you!
Example:
There's no warning either.