Message-ID: <1133960208.4290.11.camel@localhost.localdomain>
Date: 2005-12-07T12:56:48Z
From: Marc Schwartz
Subject: Plot
In-Reply-To: <43968A70.2090402@metrak.com>
On Wed, 2005-12-07 at 18:08 +1100, paul sorenson wrote:
> Apple Ho wrote:
> > Hello,
> >
> > I have a problem about using the command "plot". Suppose I have some
> > points, and one of them is (0,0), how can I show the figure with this
> > point which is at the corner?
>
> How close to the corner do you want it?
>
> > plot(0, 0, xlim=c(0, 1), ylim=c(0,1))
> you could also add:
> > grid()
By default, R adds +/- 4% to each axis range, based upon the range of
the x and y values or the 'xlim' and 'ylim' arguments.
This behavior is set by pars 'xaxs' and 'yaxs', which are set to "r" by
default. Setting both to "i" will provide exact axis ranges.
Note the difference between:
plot(0:5, 0:5)
and
plot(0:5, 0:5, xaxs = "i", yaxs = "i")
See ?par for more information.
HTH,
Marc Schwartz