[R] Alignment of axes intersection

Greg Snow Greg.Snow at imail.org
Tue May 20 18:21:11 CEST 2008


Mathematicians like to have axes cross at 0, the general rule for statistics is to have the axes positioned so that they help you understand the data, but don't interfere with the actual points (or force too much whitespace by being put to far away from the data), so the default positioning follows that idea.  If you really want the axes to cross at 0 you can do:

> plot(0:10, 0:10, axes=FALSE)
> axis(1, pos=0)
> axis(2, pos=0)



--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111



> -----Original Message-----
> From: r-help-bounces at r-project.org
> [mailto:r-help-bounces at r-project.org] On Behalf Of David Afshartous
> Sent: Tuesday, May 20, 2008 9:50 AM
> To: r-help at r-project.org
> Subject: [R] Alignment of axes intersection
>
>
> All,
>
> Very basic question I can't seem to find the answer to:
>
> plot(0:10, 0:10)
>
> The axes intersection is not aligned at (0,0) in the lower left.
> How does one force this?
>
> I searched for graphical parameters under par(graphics) but
> can't seem to find it.
>
> Thanks!
> David
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list