时间:2021-05-20
setwd("C:/Users/75377/Desktop/SHEEP_ROH")png("12.png",width = 7000,height = 5500,pointsize = 170)par(mai = c(12,12,12,12),mgp = c(2.1,0.5,0)) #地图数据下载http://cos.name/wp-content/uploads/2009/07/chinaprovinceborderdata_tar_gz.ziplibrary(maptools)x <- readShapePoly ( 'bou2_4p.shp' )plot(x,xlim=c(70,138),ylim = c(25, 45), lwd = 12, ,panel.first = grid(lwd=10))axis(1,lwd=20,font = 2,cex.axis=1.3,tcl=-0.3)axis(2,lwd=20,font = 2,cex.axis=1.3,tcl=-0.3)axis(3,lwd=20,font = 2,cex.axis=1.3,tcl=-0.3)axis(4,lwd=20,font = 2,cex.axis=1.3,tcl=-0.3)box(which = "plot",lwd=20)library(REmap)options(remap.ak = "个人秘钥")city_vec = c("北京","上海","广州","深圳","重庆")pos <- get_geo_position (city_vec)pospoints(pos$lon,pos$lat, pch= c(15,16,17,25,18),bg = "green", cex=c(1.3,1.3,1.3,1.3,2), col=c("red","cyan","blue","green","purple"))pos$lon <- as.numeric(pos$lon)pos$lat <- as.numeric(pos$lat)text(x = pos$lon[1]+2.5, y = pos$lat[1], labels = "AA", font = 2,col="red",cex=0.7)text(x = pos$lon[2]+2.5, y = pos$lat[2], labels = "BB", font = 2,col = "cyan",cex = 0.6)text(x = pos$lon[3]+2.5, y = pos$lat[3]+0.5, labels = "CC", font = 2,cex = 0.6,col = "blue")text(x = pos$lon[4]+2.5, y = pos$lat[4]-0.5, labels = "DD", font = 2,cex=0.6,col = "green")text(x = pos$lon[5]+2.5, y = pos$lat[5], labels = "EE", font = 2,cex=0.6,col = "purple")legend("bottomright",c("AA","BB","CC","DD","EE"),inset = 0.04, pch = c(15,16,17,25,18),cex=0.8,text.font = 2, col=c("red","cyan","blue","green","purple"), pt.bg ="green",box.lwd =15,pt.cex = c(1.2,1.4,1.2,1.2,1.9))dev.off()
到此这篇关于R语言绘制地图实例讲解的文章就介绍到这了,更多相关R语言绘制地图内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
GPS导航让我们几乎很难迷失方向。虽然技术的发展让绘制地图变得相当简单,但是人类事实上花了几个世纪的时间来完善绘制地图的技术。那么你知道古人如何绘制地图吗?
1.地图绘制过程原理给定范围边界经纬度数据,再给它个名字就构成了绘制地图的基础。也就是说,你可以绘制任意形状的地图版块。2.地图数据生成中国以及省市县等地图的基
ECharts可以很方便的在网页上绘制地图,图表,并且可以提供下载图像,放大,缩小,拖动等功能,今天主要说一下它的地图类型(type:'map')是如何实现的。
博主最近发现了python中一个好玩的包叫basemap,使用这个包可以绘制地图。值得说一下的是,basemap还没有pip检索,因此不能直接使用pipinst
前言本文采用PyEchartsv1.x版本进行绘制地图。注:PyEcharts分为v0.5.x和v1.x两个大版本,v0.5.x和v1.x间不兼容,v0.5.x