<p>我想你需要静态地图。</p>
<p><a href="https://i.stack.imgur.com/jhM92.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jhM92.png" alt="alt text"/></a><br/>
<sub>(来源:<a href="http://files.eduardoleoni.com/mapUS.png" rel="nofollow noreferrer">eduardoleoni.com</a>)</sub></p>
<p>1)在census.gov上获取<a href="http://www.census.gov/geo/www/cob/zt_metadata.html" rel="nofollow noreferrer">zip</a>边界和<a href="http://www.census.gov/geo/www/cob/st2000.html" rel="nofollow noreferrer">state</a>边界的形状文件:</p>
<p>2)使用我在<a href="https://stackoverflow.com/questions/1260965/developing-geographic-thematic-maps-with-r">SO question</a>中发布的plot.heat函数。</p>
<p>例如(假设在map子目录中有maryland shapefile):</p>
<pre><code>library(maptools)
##substitute your shapefiles here
state.map <- readShapeSpatial("maps/st24_d00.shp")
zip.map <- readShapeSpatial("maps/zt24_d00.shp")
## this is the variable we will be plotting
zip.map@data$noise <- rnorm(nrow(zip.map@data))
## put the lab point x y locations of the zip codes in the data frame for easy retrieval
labelpos <- data.frame(do.call(rbind, lapply(zip.map@polygons, function(x) x@labpt)))
names(labelpos) <- c("x","y")
zip.map@data <- data.frame(zip.map@data, labelpos)
## plot it
png(file="map.png")
## plot colors
plot.heat(zip.map,state.map,z="noise",breaks=c(-Inf,-2,-1,0,1,2,Inf))
## plot text
with(zip.map@data[sample(1:nrow(zip.map@data), 10),] , text(x,y,NAME))
dev.off()
</code></pre>