[Rd] Line rendering in windows - bug?

Steve Roberts steve.roberts@man.ac.uk
Fri Feb 14 09:18:03 2003

Dear all, 

One for the windows graphics developers I guess.... 

I seem to have hit a bug in the line drawing in  windows (default 
device or explicit calls to win.metafile). As the line segments used 
to plot a curve get smaller (increased resolution)  the line drawn 
seems to get less smooth rather than more smooth, and starts to 
break up.. Attached is a toy example drawing a quadratic with 
increasing resolution. In my real example - a plot for publication - it 
is very difficult to find a compromise where the line segments are 
close enough to give a smooth-looking curve without the thing 
breaking down. Look like a bug or feature in plotting small line 
segments? Using pdf() seems to be OK which suggests a windows 
driver issue - I dimly recall something about wmf and maybe emf 
having an implicit resolution, despite being a vector format. I have 
also noticed that filled symbols (eg pch=16) are not always 
completely filled, but haven't an example to demonstrate this. 

Keep up the good work! 


 #axes and text rendered well 
#lines with large segments 
for (delta in 1:4) lines(x+delta,y,lwd=delta,type="l") 
#more detailed lines 
for (delta in 1:4) lines(x+4+delta,y,lwd=delta,type="l") 
#even more detailed lines 
for (delta in 1:4) lines(x+8+delta,y,lwd=delta,type="l") 
  Dr Steve Roberts 

Senior Lecturer in Medical Statistics,
CMMCH NHS Trust and University of Manchester Biostatistics Group,
0161 275 5192 / 0161 276 5785