[Rd] wishlist item: symbols() to accept asp argument? (PR#5328)

stephen at inf.ed.ac.uk stephen at inf.ed.ac.uk
Wed Nov 26 13:26:22 MET 2003


Here is a potential wishlist item for adding an argument (asp) to
symbols().  The following code produces a postscript file with two
pages; both should show a circle of radius 2 units.  Horizonal and
vertical arrows are drawn to check that the circle is of the correct
radius; in the first plot, the circle is wrong.  To fix this, I found
that I needed to first set up the plot bounds, using xlim, ylim and
setting asp=1 so that the units are of the same size.  (Below uses the
postscript driver, but I get similar results using x11() device.)

postscript(file="circles.ps")
symbols(x=6, y=6, circles=2, inches=F)
arrows( 6, 6, 8, 6)       #horiz radius, OK
arrows( 6, 6, 6, 8)       #vert  radius, not OK.

## better version, but must set up axes first, and guess ylim
plot(NA, xlim=c(1,10), ylim=c(4,10), asp=1)
symbols(x=6, y=6, circles=2, inches=F, xlim=c(1,10), add=T)
arrows( 6, 6, 8, 6)       #horiz radius, OK
arrows( 6, 6, 6, 8)       #vert  radius, OK.
dev.off()

My suggestion is whether asp can be set within symbols(), such that

  symbols(x=6, y=6, circles=2, inches=F, asp=1)

would then ensure that the circle is drawn correctly.

Thanks, Stephen

> version
         _                
platform i686-pc-linux-gnu
arch     i686             
os       linux-gnu        
system   i686, linux-gnu  
status                    
major    1                
minor    8.1              
year     2003             
month    11               
day      21               
language R



More information about the R-devel mailing list