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()
}


