[R-sig-Geo] adding text to levelplot panels with rasterVis and level(panel.text(...))

Andy Bunn Andy.Bunn at wwu.edu
Mon Jun 15 19:16:44 CEST 2015


Hi all, I want to add a different label to each panel of a levelplot using
panel.text. Is there a way to do this by updating the plot rather than
writing a panel function in the main call?

E.g., something like the code below rather than levelplot(s, panel =
function(x, y, ..., subscripts){} etc.)

Many thanks, Andy


require(rasterVis)
text2add <- c("plot 1", "plot 2", "plot 3")
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
s <- stack(r, r+500, r-500)
levelplot(s) +
  layer(panel.text(179500, 333000, text2add))


	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list