[R-sig-Geo] title in plot of raster::stack or brick objects

Agustin Lobo alobolistas at gmail.com
Fri Nov 20 10:34:36 CET 2015


Given
r <- raster(nrows=10, ncols=10)
r <- setValues(r, 1:ncell(r))
s <- stack(r, sqrt(r), r/sqrt(r))
names(s) <- paste0("S",1:3)
plot(s)

Is there any way to put a main title centered on the multiple plot and
get the names of the layers displayed as well?

plot(s, main="S")
puts the title for the 1st layer only and eliminates the names of the
layers from the plot

Thanks



More information about the R-sig-Geo mailing list