[R] Graphics: somethink like autoscale

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Fri Apr 21 12:31:34 CEST 2000


nicolas baurin <nicolas.baurin at univ-orleans.fr> writes:

> Hello to all of you,
> 
> What i try to do : i got data of the type (x,y) which i plot with plot
> (x,y).
> 
> i want to actualise that plot adding new points (x,y) (i did it with
> points(x,y)): how can i adjust the scale of the axis x and y
> to see all the points in the window.
> Ex: i start with plot (1,0.5). If i do points(0.8,0.5) no problem, all
> my points are visible on the graph. But if i do points(2,2),
> this point is not visible on the plot. I'm looking for a way to adjust
> the scale of the x and y axis to see all my points in the window.

Basically, you can't. The graphics model used by R is of the "no
eraser" variety: If you plot something it stays there, including axes.
So the only thing to do is to plan ahead and make the xlim and ylim
large enough to hold all of your data. 

Alternatively, I suppose you could devise a system where you buffered
up the x,y pairs and replotted if necessary (i.e. if any of the new
pairs wouldn't fit). It wouldn't be completely trivial but it should
be doable.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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