【发布时间】:2016-12-04 02:59:36
【问题描述】:
我想知道如何绘制人口比例的图像(pop.prop) 在这些位置(x 和 y),以便我可以清楚地看到人口分布?
数据如下:
pts.pr = pts.cent[pts.cent$PIDS==3, ]
pop = rnorm(nrow(pts.pr), 0, 1)
pop.prop = exp(pop)/sum(exp(pop))
pts.pr.data = as.data.frame(cbind(pts.pr@coords, cbind(pop.prop)))
x y pop.prop
3633 106.3077 38.90931 0.070022855
3634 106.8077 38.90931 0.012173106
3756 106.3077 38.40931 0.039693085
3878 105.8077 37.90931 0.034190747
3879 106.3077 37.90931 0.057981214
3880 106.8077 37.90931 0.089484103
3881 107.3077 37.90931 0.026018622
3999 104.8077 37.40931 0.008762790
4000 105.3077 37.40931 0.030027889
4001 105.8077 37.40931 0.038175671
4002 106.3077 37.40931 0.017137084
4003 106.8077 37.40931 0.038560394
4123 105.3077 36.90931 0.021653256
4124 105.8077 36.90931 0.107731536
4125 106.3077 36.90931 0.036780336
4247 105.8077 36.40931 0.269878770
4248 106.3077 36.40931 0.004316260
4370 105.8077 35.90931 0.003061392
4371 106.3077 35.90931 0.050781007
4372 106.8077 35.90931 0.034190670
4494 106.3077 35.40931 0.009379213
x 是经度,y 是纬度。
【问题讨论】:
-
当 x 和 y 值相同时,如何制作多边形?但如果您的所有值中的 x 和 y 存在一些差异,请使用 R 的传单。
-
实际上,我将多边形网格化,这里的 x 和 y 是多边形内这些单元格的质心的位置。绘制多边形的数据非常大。
-
你能给我看一张你想要的图片吗?
-
如果您只想可视化每个象限中的 pop.prop,您可以做一些简单的事情:
with(pts.pr.data, plot(x, y, cex=pop.prop*10))。但是您对“不规则形状的多边形”一词的使用让我对您真正想要的东西感到困惑。 -
图书馆(传单)图书馆(magrittr)传单()%>%addTiles()%>%addRectangles(lng1 = 102.3,lat1 = 32.078039,lng2 = 108.4,lat2 = 38.062717,fillColor =“透明" ) %>% addMarkers(lng = markers$V1, lat = markers$V2) 试试这个,看看是否可以根据需要进行修改
标签: r interpolation contour r-raster bilinear-interpolation