From baptiste.auguie at gmail.com  Fri Dec 11 15:30:10 2009
From: baptiste.auguie at gmail.com (baptiste.auguie at gmail.com)
Date: Fri, 11 Dec 2009 15:30:10 +0100 (CET)
Subject: [Rd] incorrect linetype with quartz device (PR#14129)
Message-ID: <20091211143010.45AA628320B2@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 quartz() device, either in interactive use or with pdf file output, produces
an incorrect dashed line when the data is dense. Consider the following
comparison between quartz() and pdf(),

library(grid)

comparison <- function(N=10){
  
x = seq(0, 10, length=N)
y = cos(x) 

output.quartz <- paste("quartz-", N,".pdf", sep="")
output.pdf <- paste("pdf-", N,".pdf", sep="")

pdf(output.pdf, width=4, height=4)
pushViewport(viewport(xscale=c(0, 10), yscale=c(0, 6)))
for(ind in 1:5)
grid.lines(x, y+ind, gp=gpar(lty=ind),
           default.units="native")
dev.off()

quartz(type="pdf", file=output.quartz,
       width=4, height=4)
pushViewport(viewport(xscale=c(0, 10), yscale=c(0, 6)))
for(ind in 1:5)
grid.lines(x, y+ind, gp=gpar(lty=ind),
           default.units="native")
dev.off()

}

comparison()
## the output is (almost, see PR#14128) identical

comparison(1e4)
## here the quartz output has non-homogeneous spacing 
## depending on the slope of the data
## and the aspect ratio of the device

The same behavior is observed with R2.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 quartz device (PR#14129)
baptiste.auguie at gmail.com