我首先承认这是我在 Stack Overflow 上的第一篇文章,所以如果我错过了一些更好的观点,我深表歉意。
我正在使用海岸线的矢量 shapefile 在 ggplot2 中创建一系列南极半岛地图。创建基本地图工作正常:
library(ggplot2)
library(rgdal)
# Import shapefile
peninsula <- readOGR(dsn = "C:/filepath", layer = "filename")
peninsula <- fortify(peninsula)
basic <- ggplot() +
geom_polygon(data = peninsula, aes(x = long, y = lat, group = group),
color = "gray30", size = 0.25, fill = "gray30", alpha = 0.8) +
theme(panel.background = element_rect(fill = "black"),
panel.grid.major = element_line(colour = "white", linetype = "dotted")) +
coord_map(project="stereographic", orientation=c(-90,-55,0),
ylim = c(-68, -60), xlim = c(-70, -42)) +
labs(x …Run Code Online (Sandbox Code Playgroud)