 Hi Renaud,

If you check out the levelplot function in lattice (as per Edzer), you will
notice there's an auto.key argument. It takes in a named list of arguments,
one of them being title. I use spplot example to demonstrate how to put a
"test" title over the key.

library(lattice)
trellis.par.set(sp.theme()) # sets bpy.colors() ramp
data(meuse)
coordinates(meuse) <- ~x+y
l2 = list("SpatialPolygonsRescale", layout.north.arrow(), offset =
c(181300,329800),
 scale = 400)
l3 = list("SpatialPolygonsRescale", layout.scale.bar(), offset =
c(180500,329800),
 scale = 500, fill=c("transparent","black"))
l4 = list("sp.text", c(180500,329900), "0")
l5 = list("sp.text", c(181000,329900), "500 m")

spplot(meuse, c("ffreq"), sp.layout=list(l2,l3,l4,l5), col.regions=
"black",
 pch=c(1,2,3), key.space=list(x=0.1,y=.95,corner=c(0,1)), auto.key =
list(title = "test"))


I hope that works for your plot as well.

Cheers,
Roman


On Tue, Jan 3, 2012 at 5:43 PM, Edzer Pebesma <edzer.pebesma@uni-muenster.de
> wrote:

> Not that I know of; see argument colorkey in ?lattice::levelplot.
>
> On 12/30/2011 11:38 PM, lancelot wrote:
> > Dear all,
> >
> > Is there a simple way to add a title to the color key produced by spplot
> > (package sp) for raster data sets?
> >
> > Best wishes,
> >
> > Renaud
>
> --
> Edzer Pebesma
> Institute for Geoinformatics (ifgi), University of Münster
> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
> 8333081, Fax: +49 251 8339763  http://ifgi.uni-muenster.de
> http://www.52north.org/geostatistics      e.pebesma@wwu.de
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

