spplot

0th

Percentile

Use spplot to plot a Raster* object

A wrapper function around spplot (sp package). With spplot it is easy to map several layers with a single legend for all maps. ssplot is itself a wrapper around the levelplot function in the lattice package, and see the help for these functions for additional options.

One of the advantages of these wrapper functions is the additional maxpixels argument to sample large Raster objects for faster drawing.

Keywords
methods, spatial
Methods

spplot(obj, ..., maxpixels=50000, as.table=TRUE)

rll obj A Raster* object ... Any argument that can be passed to spplot and levelplot maxpixels Integer. Number of pixels to sample from each layer of large Raster objects

See Also

plot, plotRGB

The rasterVis package has more advanced plotting methods for Raster objects

Aliases
  • spplot
  • spplot,Raster-method
  • spplot,SpatialPoints-method
  • lines,SpatialPolygons-method
Examples
# NOT RUN {
r <- raster(system.file("external/test.grd", package="raster"))
s <- stack(r, r*2)
names(s) <- c('meuse', 'meuse x 2')

spplot(s)

pts <- data.frame(sampleRandom(r, 10, xy=TRUE))
coordinates(pts) <- ~ x + y

spplot(s, scales = list(draw = TRUE), 
		xlab = "easting", ylab = "northing", 
		col.regions = rainbow(99, start=.1), 
		names.attr=c('original', 'times two'),
		sp.layout = list("sp.points", pts, pch=20, cex=2, col='black'),
		par.settings = list(fontsize = list(text = 12)), at = seq(0, 4000, 500))

# }
Documentation reproduced from package raster, version 2.9-5, License: GPL (>= 3)

Community examples

Looks like there are no examples yet.