我用 mapCountryData 创建了一个图表,但图例掩盖了美国的一部分。我该如何移动它?我的情节是通过以下方式创建的:
t = floor(df$pct/10)*10
malDF <- data.frame(country = df$n,
m = do.call(paste, c(list(t),'-',list(t+9.99),'%', sep = "")) )
malMap <- joinCountryData2Map(malDF, joinCode = "ISO3",
nameJoinColumn = "country", verbose = FALSE)
mapCountryData(malMap, nameColumnToPlot="m", catMethod = "categorical",
missingCountryCol = gray(.8), colourPalette = brewer.pal(5,'RdPu'), mapTitle=paste("Percent ", y[x]), addLegend = T)