[R-sig-Geo] spplot: character size of color key labels

Oscar Perpiñan Lamigueiro oscar.perpinan at upm.es
Thu Jun 16 12:34:47 CEST 2011


Hello,

Following the example of Edzer, you can supply a list to auto.key
(instead of only the TRUE value) with a replacement for some values:

xyplot(a~b,data.frame(a=1:3,b=1:3,c=1:3),groups=c,auto.key=list(cex=3)) 

Bye,

Oscar.

-- 
Oscar Perpiñán Lamigueiro
Dpto. Ingeniería Eléctrica
EUITI-UPM

http://procomun.wordpress.com

El Tue, 14 Jun 2011 23:52:03
+0200 Edzer Pebesma <edzer.pebesma at uni-muenster.de> escribió:
> Renaud, as spplot is a wrapper around xyplot or levelplot in package
> lattice, try to pass par.settings as a list; its contents can be
> learned from:
> 
> library(lattice)
> trellis.par.get()
> ?trellis.par.set
> 
> an example is:
> 
> xyplot(a~b,data.frame(a=1:3,b=1:3,c=1:3),groups=c,auto.key=T,par.settings=list(fontsize=list(text=20)))
> # read arg par.settings in ?xyplot
> 
> as you can see, it resizes all other characters as well. No doubt
> there is a way to do this more fine grained.
> 
> This may be personal, but I find myself rarely (if ever) in need of
> this. Font sizes can be manipulated to some extent indirectly by
> changing the size of the plotting region.
> 
> Hth,
> 
> On 06/14/2011 10:26 PM, Renaud Lancelot wrote:
> > Dear all,
> > 
> > How can I control the character size  of color key labels produced
> > by spplot ? I have unsucessfully tried to use cex, as in
> > 
> > spplot(obj, zcol = "var1",
> >              panel = function(...){
> >                  panel.polygonsplot(...)
> >                  sp.text(coordinates(obj), txt =
> > as.character(obj at data$z)) },
> >              cex = 1.5)
> > 
> > All the best,
> > 
> > Renaud
> 



More information about the R-sig-Geo mailing list