Why do linewidths (lwd) less than 1 not differ in plots produced by postscript or pdf drivers in R?

Viewed 682

The code below produces varying line widths in png, but the same apparent line widths in both postscript and pdf devices. This occurs with pdfs viewed in OS X 10.10, but produced under either that OS or in Ubuntu. (Three sample images below)

I found an unhelpful thread on r-help which suggests this shouldn't be a problem. But it is.

Why?

devices <- list(png=png,
        eps=function(...) postscript(..., horizontal=TRUE),
        pdf=pdf)

for(d in names(devices)){
  devices[[d]](file=paste0('test.', d))

  par(mfrow = c(2, 2))
  for (LW in c(0.05, 0.1, .25, .5)){
    plot(height ~ age, data=Loblolly, pch='')
    for(sd in unique(Loblolly$Seed))
      lines(height ~ age, data = subset(Loblolly, Seed == sd), lwd = LW)
    title(LW)
  }
  dev.off()
}

Pdf on os x 10.10, R 3.2.3

Pdf on os x 10.10, R 3.2.3

Pdf on ubuntu, R 3.2.4

Pdf on ubuntu, R 3.2.4

Eps on ubuntu, R 3.2.4

Eps on ubuntu, R 3.2.4

1 Answers
Related