An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20120124/5373faf1/attachment.pl>
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 -----------------------------------------
Hi list,
I'd like to add a title to a level plot from rasterVis package but I
couldn't find how. There are no examples of this on the rastervis page.
I'm not very familiar with lattice kung fu, but I've tried :
library(raster)
library(rasterVis)
r <- raster(volcano)
levelplot(r, margin = FALSE, main = "The Great Volcano")
# or
levelplot(r, margin = FALSE, main = list("The Great Volcano"))
Any other way of adding an anotation to that plot would be welcome as
well.
Thanks,
Etienne
[[alternative HTML version deleted]]
I have just remembered two working alternatives to "main": levelplot(r, sub='Volcano') levelplot(r, xlab.top='Volcano') Best, Oscar.
Hi list,
I'd like to add a title to a level plot from rasterVis package but I
couldn't find how. There are no examples of this on the rastervis
page. I'm not very familiar with lattice kung fu, but I've tried :
library(raster)
library(rasterVis)
r <- raster(volcano)
levelplot(r, margin = FALSE, main = "The Great Volcano")
# or
levelplot(r, margin = FALSE, main = list("The Great Volcano"))
Any other way of adding an anotation to that plot would be welcome as
well.
Thanks,
Etienne
[[alternative HTML version deleted]]