Skip to content
Prev 276993 / 398506 Next

newbie's question : xyplot legend with a white background

Hi:

Add a background = 'color' argument to key():

library('lattice')
xyplot(1~1,
      panel = function(x,y, ...) {
          panel.xyplot(x,y)
                  panel.abline(v=seq(0,1.4,by=0.1))
                  panel.abline(h=seq(0,1.4,by=0.1))
                }
      ,key = list (x=0.2, y=0.88,
                   points = list(col=c("red","green"),pch=20, cex=2),
                   text=list(c("aaaaaaaaa","zzzzzzzzz")),
                   background = 'white')    )

Dennis
On Thu, Nov 10, 2011 at 8:09 AM, PtitBleu <ptit_bleu at yahoo.fr> wrote: