Skip to content

Add title to rastervis levelplot

3 messages · Etienne B. Racine, Oscar Perpiñan

#
Hello,

You have found a bug. Although "main" is an explicit argument for
levelplot, it is not being used inside the method. I will fix it and
update the version at R-Forge today. 

For annotations inside the plot you can use the combination of layer
(from latticeExtra) and panel.text functions:

library(raster)
library(rasterVis)
library(latticeExtra)

r <- raster(volcano)
levelplot(r) + layer(panel.text(0.9, 0.9, 'Volcano'))

Thanks for the info.

Best,

Oscar.


-------------------
Oscar Perpi??n Lamigueiro
Dpto. Ingenier?a El?ctrica
EUITI-UPM

http://procomun.wordpress.com

-----------------------------------------
#
I have just remembered two working alternatives to "main":

levelplot(r, sub='Volcano')
levelplot(r, xlab.top='Volcano')

Best,

Oscar.