【发布时间】:2021-03-13 21:56:12
【问题描述】:
我需要使用 ggplot 和 geom_sf 绘制美国和加拿大东海岸的地图,但我希望通过投影来做到这一点,该投影将使佛罗里达州到新斯科舍省从东到西不那么夸张,例如 Lambert Conformal ,如图 3.3 所示:https://cran.r-project.org/web/packages/oce/vignettes/map_projections.html
如何在 ggplot 中使用 geom_sf 执行此操作?
这是我到目前为止的部分:
library(rnaturalearth)
library(tidyverse)
world <- ne_countries(scale = "small", returnclass = "sf")
world %>%
ggplot()+
geom_sf(fill = "darkseagreen3") +
coord_sf(xlim = c(-87, -50), ylim = c(18, 50), expand = FALSE)+
theme_classic()+
theme(axis.ticks=element_blank(),
axis.text=element_blank(),
panel.background = element_rect(color="transparent", fill = "transparent"),
plot.background = element_rect(color="transparent", fill = "transparent"))
这几乎是我需要的区域,但我希望它从东到西不要那么宽。谢谢。
【问题讨论】:
标签: r mapping spatial shapefile rgeo