[R] Plot margins

Prof Brian D Ripley ripley at stats.ox.ac.uk
Mon Nov 22 11:45:44 CET 1999


On Mon, 22 Nov 1999, Torsten Hothorn wrote:

> Dear plotting experts,
> 
> we want to display Lorenz-curves and therefore we want the x and y axis to
> meet in (0,0) without a margin. We expected par(usr=c(0,1,0,1)) to do
> this, but if the following is done:
> 
> > par(usr=c(0,1,0,1))
> > par()$usr
> 0 1 0 1			# which seems ok
> > plot(c(0,1), c(0,1), type="l")
> 
> this plots a "normal" plot with margins, and now par() gives:
> 
> > par()$usr
> -0.04  1.04  -0.04  1.04
> 
> which are the standard options. How can we force plot to use our usr
> parameter instead of the standard or are there other ways we didn`t find?
> 
> Torsten (and other users...)

Try plot(..., xaxs="i", yaxs="i"), which works in R even if the help page
says otherwise.  You will need an S book or the R Notes to explain this.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list