[R] plot() axis problem
p.murrell at auckland.ac.nz
Mon Jul 23 03:29:34 CEST 2001
> This posting just illustrates the problem with plot()
> plot(x,y,xlim=xrange) #uses ylim=range(y)
> This is the default behaviour of plot() and I think it is not sensible.
> By default the range of the y axis should span the y values corresponding
> to the points plotted. In this example the yaxis should span 1-10 rather
> than 1-310. This does the sensible thing:
> plot(x,y,xlim=xrange,ylim=range(y[x<=max(xrange) & x>=min(xrange)]))
> I suggest that plot() changes to this default behaviour.
The only objections I can think of so far concern (backward) compatibility:
(i) R currently does what S-Plus does -- that helps portability of S code
(ii) If we made this change then users' existing R code might start behaving
The second problem is a fairly significant one I think -- it is impossible
to check for all instances and the change would be potentially quite
dramatic. Perhaps you could argue that it would be sufficiently rare ...?
Any other arguments for or against?
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