Re: [R] Plot

From: Marc Schwartz <MSchwartz_at_mn.rr.com>
Date: Wed 07 Dec 2005 - 23:56:48 EST

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



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 Thu Dec 08 00:02:21 2005

This archive was generated by hypermail 2.1.8 : Thu 08 Dec 2005 - 02:29:59 EST