我使用以下方法创建了我感兴趣区域的地形图:
library(dismo)
library(rasterVis)
gm = gmap(extent(c(-155.0181, -39.61941, 41.68144, 85.1355)),zoom=NULL,type="terrain",lonlat=TRUE,scale=2)
gm <- trim(gm)
e6 <- extent(-141, -96, 46.99998, 70.0)
e6pol <- as(e6, 'SpatialPolygons')
centroid <- coordinates(e6pol)
library(Cairo)
Cairo(file="whatever.png",
type="png",
units="in",
width=4,
height=4,
pointsize=12*96/72,
dpi=1000)
levelplot(gm,maxpixel=ncell(gm),panel=panel.levelplot.raster,col.regions=gm@legend@colortable,
interpolate=TRUE,colorkey=F,margin=FALSE,at=0:255,xlab=list(label="Longitude",cex=1),yscale.components = yscale.raster.subticks,
xscale.components = xscale.raster.subticks,
ylab=list(label="Latitude",cex=1),scales=list(x=list(cex=1),y=list(cex=1)),
par.settings=list(axis.line=list(lwd=1.2), strip.border=list(lwd=1.2)),
xlim=c(-155.0997, -76.0997),ylim=c(39.09998, 80.09997 ))
dev.off()
这给了我下面的情节:
例如,如何对颜色进行选择以使水体为深蓝色和陆地区域为green
至gray
?还要添加一个颜色键。