[R] Legend in xyplot two columns

Gesmann, Markus Markus.Gesmann at lloyds.com
Thu Apr 14 12:30:09 CEST 2005


Dear R-Help

I have some trouble to set the legend in a xyplot into two rows.
The code below gives me the legend in the layout I am looking for, I
just rather have it in two rows.

library(lattice)
schluessel <- list(
               points=list( col="red", pch=19, cex=0.5 ),
               text=list(lab="John"),
               lines=list(col="blue"),
               text=list(lab="Paul"),
               lines=list(col="green"),
               text=list(lab="George"),
               lines=list(col="orange"),
               text=list(lab="Ringo"),
               rectangles = list(col= "#FFFFCC", border=FALSE),
               text=list(lab="The Beatles"),
		   )
 
xyplot(1~1, key=schluessel)

The next code gives me two rows, but repeates all the points,lines, and
rectangles.
 
schluessel2 <- list(
               points=list( col="red", pch=19, cex=0.5 ),
               lines=list(col=c("blue", "green", "orange")),
               rectangles = list(col= "#FFFFCC", border=FALSE),
               text=list(lab=c("John","Paul","George","Ringo", "The
Beatles")),
               columns=3,
 		   )
 
xyplot(1~1, key=schluessel2)

So I think each list has to have 6 items, but some with "no" content.
How do I do this?

Thank you very much!

Markus

************LNSCNTMCS01***************************************************
The information in this E-Mail and in any attachments is CON...{{dropped}}




More information about the R-help mailing list