简体   繁体   English

在没有ggplot2的情况下在R上绘制世界地图

[英]Plotting a world map on R without ggplot2

I'm trying to plot a world map on R but I don't have the version updated for ggplot2. 我正在尝试在R上绘制世界地图,但是我没有为ggplot2更新版本。 Is there a way of doing it without? 有没有办法做到这一点?

You can get an extremely simple world map with: 您可以使用以下方法获得极其简单的世界地图:

library(maps)
map('world', fill = TRUE, col = 2:8, wrap=c(-180,180) )

简单世界地图

And a somewhat better map from the mapdata package 还有来自mapdata包的更好的地图

library(mapdata)
map('worldHires', fill=TRUE, col=2:8)

雇用世界

And just for fun, here is a version with prettier colors, a blue ocean and cutting out Antarctica. 只是为了好玩,这是一个色彩更漂亮的版本,蓝色的海洋,切出南极洲。

RegHR <- map("worldHires", namesonly=TRUE, plot=FALSE)
map('worldHires', fill=TRUE, col=terrain.colors(6),  bg="#CCEEFF",
    region=RegHR[-grep("Antarctica", RegHR)])

更漂亮的世界地图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM