[R] Aspect Ratio

r.ookie r.ookie at live.com
Fri Aug 20 01:41:24 CEST 2010


Well-stated.

On Aug 19, 2010, at 4:31 PM, Spencer Graves wrote:

The 'fortunes' package contains the following:


library(fortunes)
fortune('rtfm')

This is all documented in TFM. Those who WTFM don't want to have to WTFM again
on the mailing list. RTFM.
  -- Barry Rowlingson
     R-help (October 2003)


     I see two problems with this:


           1.  It's difficult to RTFM if one does not know which FMTR.


           2. No piece of prose in any language is ever perfectly clear, complete and concise to all readers.  In learning mathematics, it is common to spend hours on one page.  I once heard of a famous professor in the middle of a lecture start to say, "It is intuitively obvious".  The he paused for 15 minutes before repeating, "Yes, it is intuitively obvious that ... ."  One of the enormous advantages of the R package system is that anything not obvious to a particular reader can be traced line by line in any number of different examples until sufficient enlightenment is achieved.


     Best Wishes,
     Spencer Graves


On 8/19/2010 3:38 PM, r.ookie wrote:
> Thanks for your example as well. Ted's example was exactly what I needed.
> 
> On Aug 19, 2010, at 3:18 PM, Gavin Simpson wrote:
> 
> On Thu, 2010-08-19 at 14:28 -0700, r.ookie wrote:
>> 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?
> If 'x' and 'y' are in the same units but one covers a larger/smaller
> range than the other, asp will make the axes be scaled in the same units
> such that the distance along the 'y' axis for 1 unit change is the same
> as the distance along the 'x' axis for a 1 unit change.
> 
> dat<- data.frame(x = seq(1, 100, length = 100),
>                  y = seq(1, 10, length = 100))
> 
> layout(matrix(1:2, ncol = 2))
> plot(y ~ x, data = dat)
> plot(y ~ x, data = dat, asp = 1, main = expression(asp == 1))
> layout(1)
> 
> If x and y are both in say metres the second plot respects the natural
> scale whereas the first doesn't.
> 
> G
> 
>> 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?

-- 
Spencer Graves, PE, PhD
President and Chief Operating Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567



More information about the R-help mailing list