我使用 rworldmap 绘制了一张地图。但我无法插入带有扩展调色板的图例。我收到了这个错误:
图例错误(.... 未使用的参数(colourVector1 = "#00008B", colourVector2 = "#0B0B90", ...
这是我的代码:
library(rworldmap)
#color pallete
colours = colorRampPalette(c("darkblue", "white"))(23)
#csvfile
dF = read.csv("/home/shops.csv", header = T)
sPDF <- joinCountryData2Map(dF,
joinCode = "NAME",
nameJoinColumn = "Country",
verbose = TRUE)
mapData = mapCountryData(
sPDF,
nameColumnToPlot="Shops",
mapTitle = "Number of facilities around the world",
addLegend = F
)
do.call( addMapLegendBoxes, c(mapData, cex=0.39, x="left", colourVector = colours))
这是我的 csv 文件的一部分:
Country Shops
1 United States 302
2 Germany 77
3 United Kingdom 67
4 Spain 60
5 France 44
6 China 35