Description Usage Arguments Details Value Author(s) See Also Examples
Raster plot for spatial data with attributes.
1 2 3 4 5 |
grd |
|
zcol |
|
pts |
|
ply |
|
net.idxs |
|
rm.idxs |
|
xlim |
|
ylim |
|
at |
|
pal |
|
contour |
|
label.contours |
|
label.pts |
|
main |
|
gr.type |
|
gr.file |
|
width, height |
|
lo |
|
ll.lines |
|
Spatial data is transformed to the map projection and datum of the raster data set, grd
.
Returns (or plots) the raster plot.
J.C. Fisher
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | data(ESRP_NED)
data(ESRP_NWIS)
data(ESRP_Boundary)
data(ESRP_Lakes)
data(ESRP_Rivers)
data(INL_Boundary)
# Plot topography
PlotRaster(ESRP_NED, "var2")
# Set axis limits, add points and long-lat grid to plot layout
pts <- ESRP_NWIS[ESRP_NWIS$network.nm == "State", ]
xlim <- c(10000, 328000)
ylim <- c(81200, 335700)
PlotRaster(ESRP_NED, "var2", pts, ESRP_Boundary, xlim = xlim, ylim = ylim,
pal = terrain.colors, label.pts = "map.no", ll.lines = TRUE)
# Plot hill shade, add lakes, river, and INL boundary to the plot layout
slp <- terrain(raster(ESRP_NED), opt = "slope")
asp <- terrain(raster(ESRP_NED), opt = "aspect")
grd <- as(hillShade(slp, asp, 40, 270), "SpatialGridDataFrame")
zlim <- range(grd[[1]], na.rm = TRUE)
at <- seq(zlim[1], zlim[2], length.out = 50)
pal <- function(n) grey(0:50 / 50)[1:n]
lo <- list()
lo[[1]] <- list("sp.polygons", ESRP_Lakes, col = "#1B70E0", fill = "#BAE4E5",
first = FALSE)
lo[[2]] <- list("sp.lines", ESRP_Rivers, col = "#1B70E0", first = FALSE)
lo[[3]] <- list("sp.polygons", INL_Boundary, col = "#000000", first = FALSE)
PlotRaster(grd, 1, xlim = xlim, ylim = ylim, at = at, pal = pal, lo = lo)
# Set new axis limits
pts <- ESRP_NWIS[ESRP_NWIS$network.nm == "INL", ]
xlim <- c(178000, 257500)
ylim <- c(202000, 272000)
PlotRaster(ESRP_NED, "var2", pts, ESRP_Boundary, xlim = xlim, ylim = ylim,
pal = terrain.colors, ll.lines = TRUE, contour = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.