Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.10.10107201132260.6011-100000@localhost.localdomain>
Date: 2001-07-20T10:38:26Z
From: Bill Simpson
Subject: plot() axis problem

This posting just illustrates the problem with plot()

x<-1:20
y<-c(1:10,301:310)
plot(x,y)
xrange<-c(1,10)
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.

Bill

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