G. Draisma
2008-Jul-30 13:41 UTC
[R] Unexpected line type in lattice plot key on pdf device
L.S., With the code below, on the Windows screen the line types in the key show as solid and dashed as in the graph, and in the pdf file they show as solid in the key and solid and dashed in the graph. I would not expect that, but may be I get something wrong. Gerrit. ------- library(lattice) # pdf("pietje.pdf") x<-0:10 xyplot((x^0.5)+(x^0.75)~x,type="o",lty=c(1,2), auto.key=list(points=F,lines=T,columns=2, type="o",divide=1)) # dev.off() ------- -- Gerrit Draisma Department of Public Health Erasmus MC, University Medical Center Rotterdam Room AE-103 P.O. Box 2040 3000 CA Rotterdam The Netherlands Phone: +31 10 7043124 Fax: +31 10 7038474 http://mgzlx4.erasmusmc.nl/pwp/?gdraisma
Deepayan Sarkar
2008-Jul-31 00:18 UTC
[R] Unexpected line type in lattice plot key on pdf device
On Wed, Jul 30, 2008 at 6:41 AM, G. Draisma <g.draisma at erasmusmc.nl> wrote:> L.S., > With the code below, > on the Windows screen the line types in the key show > as solid and dashed as in the graph, > and in the pdf file they show > as solid in the key and solid and dashed in the graph. > I would not expect that, > but may be I get something wrong. > Gerrit. > > ------- > library(lattice) > # pdf("pietje.pdf") > x<-0:10 > xyplot((x^0.5)+(x^0.75)~x,type="o",lty=c(1,2), > auto.key=list(points=F,lines=T,columns=2, type="o",divide=1)) > # dev.off() > -------I'm surprised that you see differences between windows() and pdf(). In any case, the correct call would be something like xyplot((x^0.5)+(x^0.75)~x,type="o", par.settings = simpleTheme(lty=c(1,2)), auto.key=list(points=F,lines=T,columns=2, type="o",divide=1))