From baptiste.auguie at gmail.com  Fri Dec 11 15:15:13 2009
From: baptiste.auguie at gmail.com (baptiste.auguie at gmail.com)
Date: Fri, 11 Dec 2009 15:15:13 +0100 (CET)
Subject: [Rd] incorrect linetype with pdf device (PR#14128)
Message-ID: <20091211141513.D509D28320B2@mail.pubhealth.ku.dk>

Full_Name: baptiste augui?
Version: 2.10.1 RC (2009-12-06 r50690) 
OS: Mac OSX 10.5
Submission from: (NULL) (90.25.215.172)


The following code, run with a vanilla R session, produces different visual
output for the two devices,

library(grid)

pdf("test-pdf.pdf")
grid.newpage()
grid.lines(gp=gpar(lty="13", lineend = "butt"))
dev.off()

png("test-png.png")
grid.newpage()
grid.lines(gp=gpar(lty="13", lineend = "butt"))
dev.off()

The pdf output, opened with Acrobat, shows only extremely thin marks (artifacts)
at low zoom factor, and invisible line at higher zoom factor. The same file
opened with Adobe Illustrator reveals that the line pattern lty=13 has in fact
become 04 (0 solid length, 4 space). Similarly, lty=123456 would produce 032547,


pdf("test-123456.pdf")
grid.newpage()
grid.lines(gp=gpar(lty="123456", lineend = "butt"))
dev.off()

while the same command with quartz() gives the correct line pattern,

quartz(type="pdf", file="test2-123456.pdf")
grid.newpage()
grid.lines(gp=gpar(lty="123456", lineend = "butt"))
dev.off()

The same behavior is observed with R 2.11.0 (2009-12-09 r50690) 


sessionInfo()
R version 2.10.1 RC (2009-12-06 r50690) 
i386-apple-darwin9.8.0 

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods  
[8] base



[Rd] incorrect linetype with pdf device (PR#14128)
baptiste.auguie at gmail.com