Skip to content
Prev 255469 / 398506 Next

Simple lattice question

,col='black',type='b',
... that works. Thanks Peter (sorry I misspelled your name b4). The clean code is now:

require(lattice)
data <- data.frame(SP=sort(rep(as.factor(c('A','B','C','D','E')),12)),
                   x=rpois(60,10),
                   y=rep(c(rep(0,4),rep(10,4),rep(20,4)),5),
                   z=rep(1:4,15))
xyplot(x~y|SP,data=data,groups=z,layout=c(2,3),pch=1:4,lty=1:4,col='black',type='b',
       key=list(x = .65, y = .75, corner = c(0, 0),
                  lines=list(pch=1:4, lty=1:4, type='b'),
                  title=expression(CO^2),
                  text=list(lab = as.character(unique(data$z)))))

David's code works too (thanks to you too!) and is somewhat shorter

xyplot(x~y|SP, data=data,groups=z, layout=c(2,3), par.settings=simpleTheme(pch=1:4,lty=1:4,col='black'), type="b", 
       auto.key = list(x = .6, y = .7, lines=TRUE, corner = c(0, 0)))

but the lines and symbols are on different columns, and the line types look as if they were in bold.

Rub?n


____________________________________________________________________________________ 

Dr. Rub?n Roa-Ureta
AZTI - Tecnalia / Marine Research Unit
Txatxarramendi Ugartea z/g
48395 Sukarrieta (Bizkaia)
SPAIN