Bars to be plotted over map

此生再无相见时 提交于 2019-11-29 08:47:58

You could try using subplots:

# ... plot(getMap()) df <- merge(x=ddf, y=sPDF@data[sPDF@data$ADMIN, c("ADMIN", "LON", "LAT")], by.x="country", by.y="ADMIN", all.x=TRUE) require(TeachingDemos) for (i in 1:nrow(df))    subplot(barplot(height=as.numeric(as.character(unlist(df[i, 2:4], use.names=F))),                    axes=F,                    col=rainbow(3), ylim=range(df[,2:4])),           x=df[i, 'LON'], y=df[i, 'LAT'], size=c(.3, .3)) legend("topright", legend=names(df[, 2:4]), fill=rainbow(3)) 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!