Skip to content

Trying to get xlim to do what I want

3 messages · Anon., Brian Ripley, Ian Wilson

#
I'm trying to draw a plot with both the x and y axes starting at zero.
However, even with xlim and ylim specified (e.g.
plot(x,y,ylim=c(0,800),xlim=c(0,2000)) ), the axes still start just
below zero.  The lowest x and y values are sufficiently higher than 0 so
that having symbols overlapping isn't a problem.  How does one force R
to do exactly what you want?

Bob

--
Bob O'Hara
Metapopulation Research Group
Division of Population Biology
Department of Ecology and Systematics
PO Box 17 (Arkadiankatu 7)
FIN-00014 University of Helsinki
Finland

tel: +358 9 191 7382  fax: +358 9 191 7301
email: bob.ohara at helsinki.fi
To induce catatonia, visit:
http://www.helsinki.fi/science/metapop/

I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.  -
Poul Anderson


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Wed, 17 May 2000, Anon. wrote:

            
xaxs="i", yaxs="i"

See ?par for an explanation.
#
plot(x,y,ylim=c(0,800),xlim=c(0,2000)),xaxs="i", yaxs="i");

see help(par) for details
the relevant bit is:

xaxs 
The style of axis interval calculation to be used for the x-axis. Possible
values are "r", "i", "e", "s", "d". The styles are generally controlled by
the range of data or xlim, if given. 
Style "r" (regular) first extends the data range by 4 percent and then
finds an axis with pretty labels that fits within the range. 
Style "i" (internal) just finds an axis with pretty labels that fits within
the original data range. 
Style "s" (standard) finds an axis with pretty labels within which the
original data range fits. 
Style "e" (extended) is like style "s", except that it is also ensured that
there is room for plotting symbols within the bounding box. 
Style "d" (direct) specifies that the current axis should be used on
subsequent plots. (Only "r" and "i" styles are currently implemented) 

Ian Wilson
Dr Ian J Wilson
Department of Mathematical Sciences
University of Aberdeen
Aberdeen, AB24 3UE

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._