[R] Aspect ratio and limits

From: Barry Rowlingson <B.Rowlingson_at_lancaster.ac.uk>
Date: Wed 20 Apr 2005 - 01:28:49 EST

Suppose I have the following data I want to scatterplot:

> xy

       [,1] [,2]
  [1,] 0 0
  [2,] 21 4

I start up a graphics window and fire away:

> plot(xy)

> plot(xy, asp=1)

> plot(xy, asp=1, ylim=c(0,4))

  If I leave par(pty='m') then I can change the shape of the graphics window until I get the effect I want, but this seems an unsatisfactory way of doing it, and when I come to make a PostScript version I need to set the dimensions of the PS device correctly.

  Is there a right way to do this? The only way I can think is to do the plot without box and axes, and then add them afterwards, but that could get very messy. Have I missed something obvious?


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Apr 20 01:36:53 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:17 EST