Skip to content
Prev 14074 / 15075 Next

Dashed line not evenly separated

Dear JL and Simon,

I too tried the quartz graphics device in version r81808 of R-devel, and 
though it's a clear improvement, as JL mentioned, the dashed lines that 
it creates aren't evenly spaced.

I've attached a PDF created by saving the graph for my example from the 
quartz graphics device. Compare this to a PDF created by the pdf 
graphics device -- using a PDF viewer like Acrobat that renders the plot 
accurately. (I'm not sure whether PDF attachments are allowed on the 
list, but if not, it wouldn't be hard to recreate the graph.)

I also tried timing the computation in both R 4.1.2 and R-devel, with 
the following results:

   R 4.1.2

 > microbenchmark(
   +   plot(log10(1:1e4), lty = 2, type="l")
   + )
Unit: milliseconds
expr      min       lq     mean   median
plot(log10(1:10000), lty = 2, type = "l") 24.13186 25.89029 36.99181 
26.05741
uq      max neval
26.45445 1072.527   100

   R-devel:

 > library("microbenchmark")
 > microbenchmark(
   +   plot(log10(1:1e4), lty = 2, type="l")
   + )
Unit: microseconds
expr     min      lq     mean   median
plot(log10(1:10000), lty = 2, type = "l") 754.687 859.073 6372.026 944.4145
uq      max neval
14259.37 38235.57   100


So, as expected, the quartz device in R-devel is substantially slower.

Best,
  John
On 2022-02-25 10:20 a.m., Zhang, Jialin wrote: