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

Tiffany Smith smithtiffanyt at gmail.com
Wed May 27 15:26:15 CEST 2015


Thanks so much, that worked perfectly!
> On May 23, 2015, at 11:28 AM, Oscar Perpiñan <oscar.perpinan at gmail.com> wrote:
> 
> 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 <http://oscarperpinan.github.io/>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list