A couple of additional examples of when asp is important to use:

The command abline(0,1) adds a line to the current plot, this line is often 
referred to as the 45 degree line, but the angle with the axes is only 45 
degrees when asp==1, setting asp=1 will enforce this.

There are multiple packages that produce maps relating to real world geography. 
 These maps look really funny (and not related to real world geography) if they 
are allowed to fill the available graph space rather than enforcing an 
appropriate aspect ratio (usually not 1).

William Cleveland did research showing that many plots are easier to interpret 
when the aspect ratio is set so that the average angle of the absolute value of 
lines of interest is 45 degrees.  Compare the following 2 plots (look at how 
fast the sunspots increase vs. how fast they decrease):

plot(sunspots, type='l')
plot(sunspots, type='l', asp=1/10)

Another function to look at if you don't want all the white space inside of the 
plot is the squishplot function in the TeachingDemos package.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111


> -----Original Message-----
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of r.ookie
> Sent: Thursday, August 19, 2010 3:29 PM
> To: David Winsemius
> Cc: r-help@r-project.org
> Subject: Re: [R] Aspect Ratio
> 
> Well, I had to look further into the documentation to see 'If asp is a
> finite positive value then the window is set up so that one data unit
> in the x direction is equal in length to asp * one data unit in the y
> direction'
> 
> Okay, so in what situations is the 'asp' helpful?
> 
> On Aug 19, 2010, at 2:24 PM, David Winsemius wrote:
> 
> 
> On Aug 19, 2010, at 5:13 PM, r.ookie wrote:
> 
> > set.seed(1)
> > x <- rnorm(n = 1000, mean = 0, sd = 1)
> > plot(x = x, asp = 2000)
> >
> > Could someone please explain what the 'asp' parameter is doing?
> 
> You want us to read the help page to you?
> 
> --
> 
> David Winsemius, MD
> West Hartford, CT
> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to