[R] correct line types in lattice legends

Gerrit Draisma g.draisma at erasmusmc.nl
Sat Jun 6 16:33:59 CEST 2009


Hallo R-users,
I do not understand how to specify the correct
line and symbol types in the legends of a lattice xyplot.
This is what I tried, but the line types and symbol  in the
graph are not seen in the legend.
Any help is appreciated.

Thanks,
Gerrit.

library(lattice)
s<-rep(1:3,len=10)
x<- 1:10
y<- x+s+rnorm(10)
d<-data.frame(s,x,y)
xyplot(y~x, groups=s,data=d, type="b", pch=1:3,lty=1:3, 
auto.key=list(text=c("A","B","C"),points=FALSE,lines=TRUE,
  type="b",lty=1:3,divide=1,pch=1:3,columns=3))




More information about the R-help mailing list