[R-sig-Geo] grid.text with rasterVis::layerplot

Oscar Perpiñan oscar.perpinan at gmail.com
Sat May 23 17:28:40 CEST 2015


Hi,

It is easier with the panel.number function. Following the example proposed
by Tim:

library(rasterVis)

f <- system.file("external/test.grd", package="raster")
r <- raster(f)
s <- stack(r, r+500, r-500)

labs <- c("a.", "b.", "c.")

levelplot(s) + layer(grid.text(labs[panel.number()], .95, .1))

Best,

Oscar.

-----------------------------------------------------------------
Oscar Perpiñán Lamigueiro
Dpto. Ing. Eléctrica, Electrónica, Automática y Física Aplicada (ETSIDI-UPM)
Grupo de Sistemas Fotovoltaicos (IES-UPM)
URL: http://oscarperpinan.github.io

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list