如何获取spplot(晶格)以免在多边形周围绘制边框 [英] How to get spplot (lattice) to not draw borders around polygons

查看:136
本文介绍了如何获取spplot(晶格)以免在多边形周围绘制边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个按邮政编码统计的表格,其中要绘制很多多边形(准确地说是30,357个).因此,当我pdfspplot我所看到的只是边界,而不是内部的弧度.

I have a tally by zip code which is a lot of polygons to plot (30,357 to be precise). Consequently when I pdf the spplot all I see are the borders not the choropleth interiors.

因此,我想关闭绘制边框的功能,或者至少能够使边框更薄.但是,在?spplot中挖掘及其各种分支(面板功能,水平图等)时,显示为空.

Therefore, I'd like to turn off plotting the borders, or at least be able to make them much, much thinner. However, digging around in ?spplot and its various offshoots (the panel function, levelplot, etc.) have come up empty.

下面是一个可以使用的示例(这里的边界不是很突出,但是会给它们一个十亿个多边形):

Here's an example to work with (the borders aren't that prominent here but they would be given a bajillion polygons):

library(sp)
Srs1 = Polygons(list(Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))), "s1")
Srs2 = Polygons(list(Polygon(cbind(c(5,4,2,5),c(2,3,2,2)))), "s2")

SpDF <- SpatialPolygonsDataFrame( SpatialPolygons(list(Srs1,Srs2)), 
            data.frame( z=1:2, row.names=c("s1","s2") ) )
spplot(SpDF, zcol="z")

推荐答案

看起来您只需要设置col="transparent",就像这样:

It looks like you just need to set col="transparent", like so:

spplot(SpDF, zcol="z", col="transparent")

这篇关于如何获取spplot(晶格)以免在多边形周围绘制边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆