[R] lattice: passing multiple lty values to the key/legend
Deepayan Sarkar
deepayan.sarkar at gmail.com
Sat Oct 10 10:09:11 CEST 2009
On Thu, Oct 8, 2009 at 10:52 AM, Folkes, Michael
<Michael.Folkes at dfo-mpo.gc.ca> wrote:
> hi all,
> It's not clear to me how (or if) I can pass multiple values for lty to a key in xyplot?
> I've tried: lines=list(lty=1:3), to no avail.
> Do I need to use something other than auto.key?
> (Deepayan, if you're out there, I have your book and must admit the answer isn't jumping out at me.)
It's probably not spelled out as clearly as it could have been, but
see Section 7.1.6 (p 125).
-Deepayan
> thanks in advance!
> Michael Folkes
>
> example code:
> #____________________________
>
> xx<-data.frame(v1=rep(letters[1:3],rep(3,3)),v2=rep(1:3,3),v3=rep(1:3,rep(3,3)))
> xyplot(v3~v2,data=xx,
> xlab='',
> group=v1,type='l', lty=1:3 ,
>
> auto.key=list(text = levels(as.factor(xx$v1)) , title='',
> cex.title=.75,points=F,lines = T,cex=1, x = .5, y = -0.1,corner = c(0, 0),
> between=1,columns=3,between.columns=2),
> )
>
>
> _______________________________________________________
> Michael Folkes
> Salmon Stock Assessment
> Canadian Dept. of Fisheries & Oceans
> Pacific Biological Station
> 3190 Hammond Bay Rd.
> Nanaimo, B.C., Canada
> V9T-6N7
> Ph (250) 756-7264 Fax (250) 756-7053 Michael.Folkes at dfo-mpo.gc.ca <mailto:Michael.Folkes at dfo-mpo.gc.ca>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list