dapengde 换投影坐标系,选一个观察角度(可选),填充颜色,图我也不贴了
换观察角度
worldmap <- map_data("world")
ggplot(worldmap, aes(long, lat, group = group)) +
geom_polygon(aes(fill = region), show.legend = FALSE) +
coord_map(
xlim = c(-120, 40), ylim = c(30, 90),
orientation = c(90, 0, 0)
)
换投影坐标系
ggplot(worldmap, aes(long, lat, group = group)) +
geom_polygon(aes(fill = region), show.legend = FALSE) +
coord_map("ortho",
xlim = c(-120, 40), ylim = c(30, 90)
)
二者皆换
ggplot(worldmap, aes(long, lat, group = group)) +
geom_polygon(aes(fill = region), show.legend = FALSE) +
coord_map("ortho", xlim = c(-120, 40), ylim = c(30, 90), orientation = c(60,-80,0))
这个问题和帖子如何放大地图的局部 <https://d.cosx.org/d/419371> 有相似之处。此外,参考 <https://ggplot2-book.org/coord.html> 末尾不同坐标变化对比,详细解释 <https://geocompr.robinlovelace.net/reproj-geo-data.html>
从所选范围来看,北极点是比较好的观察角度
worldmap <- map_data("world")
ggplot(worldmap, aes(long, lat, group = group)) +
geom_polygon(aes(fill = region), show.legend = FALSE) +
coord_map("ortho", xlim = c(-120, 40), ylim = c(30, 90), orientation = c(90,0,0))
"ortho" 表示 orthographic()
(R 的部分匹配) viewed from infinity 从无穷远点观察, 解释来自
?mapproj::mapproject