绘制R地图库中的国家:灰色边界,FILL = TRUE

时间:2016-07-20 10:44:42

标签: r maps

我正在尝试在R地图中绘制国家/地区。但是,当我使用FILL = TRUE时,我所有的国家边界都是黑色的。我想要他们在格雷。这是我的代码:

library(maps)       # Provides functions that let us plot the maps
library(mapdata)    # Contains the hi-resolution points that mark out the Cnt 


countries=c("Argentina","Armenia","Australia","Bahrain","Belgium","Botswana","Bulgaria","Canada",   "Chile","Tawain",   "Croatia","Cyprus", "Czech Republic",   "Denmark","Egypt","UK:Great Britain","Finland", "France",   "Georgia",  "Germany",  "China:Hong Kong",  "Hungary",  "Indonesia",    "Iran", "Ireland",  "Israel",   "Italy",    "Japan",    "Jordan",   "Kazakhstan",   "Korea",    "Kuwait",   "Lebanon",  "Lithuania",    "Malaysia", "Malta",    "Morocco",  "Netherlands",  "New Zealand",  "UK:Northern Ireland",  "Norway",   "Oman", "Palestine",    "Poland",   "Portugal", "Qatar",    "Russia",   "Saudi Arabia", "Serbia",   "Singapore",    "Slovak Republic",  "Slovenia", "South Africa", "Spain",    "Sweden",   "Thailand", "Turkey",   "United Arab Emirates", "USA")                  

map('world', resolution=1, col="darkgray")
map('world', countries, resolution=1, fill = T, col = "royalblue", add = T)
map('world', resolution=1,col="darkgray", add=TRUE)

任何想法都将受到赞赏。

由于 Jº

1 个答案:

答案 0 :(得分:0)

要更改边界的颜色,请添加参数border =' darkgrey'。此参数未在地图'地图'的手册页中明确列出。因为它实际上是调用“多边形”的参数。在' ...'中提到了它。但是,手册页的一部分。

map('world', countries, resolution=1, fill = T, col = "royalblue", border="darkgrey", add = T)