Skip to content

pdf indifferent to lwd after some small number<1 (e.g. 0.18)

2 messages · Chuen Tan, Ben Bolker

#
Hi,

To plot a figure, I used lwd=0.18 in the function lines() to plot very fine lines. However, using png() or pdf() to save the figure, it appears that lwd has no effect on pdf() beyond some small number (e.g. 0.18) and the lines looks much thicker than png(). Setting lwd<0.18 does not make the lines any finer in pdf(). I also tried specifying the argument lwd in par() instead and still faced the same problem. 

My understanding is pdf() allows lwd<1 but it seems that there is a lower bound. I hope to use pdf() instead of png() because the computer server gives the following error message when png is used:
Error in X11(paste("png::", filename, sep = ""), width, height, pointsize,  : 
  unable to start device PNG
In addition: Warning message:
In png(file = "tmp.png") : unable to open connection to X11 display ''
Thanks for the help and advice in advance regarding the problem I am facing.

Best regards,
stan

My mac machine:
_                            
platform       x86_64-apple-darwin9.8.0     
arch           x86_64                       
os             darwin9.8.0                  
system         x86_64, darwin9.8.0          
status                                      
major          2                            
minor          11.1                         
year           2010                         
month          05                           
day            31                           
svn rev        52157                        
language       R                            
version.string R version 2.11.1 (2010-05-31)
The computer sever:
_                           
platform       x86_64-unknown-linux-gnu    
arch           x86_64                      
os             linux-gnu                   
system         x86_64, linux-gnu           
status                                     
major          2                           
minor          9.0                         
year           2009                        
month          04                          
day            17                          
svn rev        48333                       
language       R                           
version.string R version 2.9.0 (2009-04-17)
#
Chuen Tan <tcs76.geo <at> yahoo.com> writes:
This bug has been fixed in the development version of R: see
<http://stat.ethz.ch/R-manual/R-devel/doc/html/NEWS.html> and search for "lwd"

  For a Mac, you can get the development version from
http://r.research.att.com/ .

  Your PNG issue may (?) be that you don't have X11 available on
your machine -- see the MacOS R FAQ.