Here is one approach using the nifty layer() function from the Extra lattice package:
# (1) Load required libraries library(sp) library(rgeos) # For its readWKT() function library(latticeExtra) # For layer() # (2) Prepare some example data sp1 = readWKT("POLYGON((0 0,1 0,1 1,0 1,0 0))") sp2 = readWKT("POLYGON((0 1,0.5 1.5,1 1,0 1))") sp3 = readWKT("POLYGON((0.5 0,0.5 0.5,0.75 0.5,0.75 0, 0.5 0))") # spplot provides "Plot methods for spatial data with attributes", # so at least the first object plotted needs a (dummy) data.frame attached to it. spdf1 <- SpatialPolygonsDataFrame(sp1, data=data.frame(1), match.ID=1) # (3) Plot several layers in a single panel spplot(spdf1, xlim=c(-0.5, 2), ylim=c(-0.5, 2), col.regions="grey90", colorkey=FALSE) + layer(sp.polygons(sp2, fill="saddlebrown")) + layer(sp.polygons(sp3, fill="yellow"))

Alternatively, you can achieve the same result with the spplot() sp.layout= . (Specifying first=FALSE ensures that the βroofβ and βdoorβ will be displayed after / above the gray square, indicated as spplot() first argument.)
spplot(spdf1, xlim=c(-0.5, 2), ylim=c(-0.5, 2), col.regions="grey90", colorkey=FALSE, sp.layout = list(list(sp2, fill="saddlebrown", first=FALSE), list(sp3, fill="yellow", first=FALSE)))
Josh o'brien
source share