[Rd] rendering dashed steps produces solid horizontal lines (PR#9953)

From: <chris.bainbridge_at_gmail.com>
Date: Wed, 10 Oct 2007 16:35:25 +0200 (CEST)


Full_Name: Chris Bainbridge
Version: 2.2.1
OS: Linux
Submission from: (NULL) (86.157.4.96)

The following python script will render two pdf files, one with lines and one with steps. The pdf with steps (s.pdf) renders the horizontal line as a solid when it should be dotted as in lpdf. It seems as though R tries to render every data point individually when using steps, but manages to join them all together as a straight line when using lines.

#!/usr/bin/python                                                               
                  
import os                                                                       
                  
                                                                                
                  
f=open('x.txt','w')                                                             
                  
i=0                                                                             
                  
f.write('x y\n')                                                                
                  
while i<100:                                                                    
                  
    f.write('%f %f\n'%(i,0.5))                                                  
                  
    i+=1                                                                        
                  
f.close()                                                                       
                  
rscr="""pdf('%s.pdf')                                                           
                  
d <- read.table('x.txt', header=T)                                              
                  
attach(d)                                                                       
                  
plot(x,y, bty='n', las=1, lty=2,type='%s')                                      
                  
"""                                                                             
                  
f=open('l.r','w')                                                               
                  
f.write(rscr%('l','l'))                                                         
                  
f.close()                                                                       
                  
os.system('R -q --no-save < l.r')                                               
                  
f=open('s.r','w')                                                               
                  
f.write(rscr%('s','s'))                                                         
                  
f.close()                                                                       
                  

os.system('R -q --no-save < s.r')



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 10 Oct 2007 - 15:17:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Oct 2007 - 11:37:10 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.