Hi Folks, Maybe I've missed it already being available somehow, but if the following isn't available I'd like to suggest it. If you're happy to let plot() choose its own limits, then of course plot(x,y) will do it. If you know what limits you want, then plot(x,y,xlim=c(x0,x1),ylim(y0,y1) will do it. But sometimes one would like to a) make sure that (e.g.) the y-axis has a lower limit (say) 0 b) let plot() choose the upper limit. In that case, something like plot(x,y,ylim=c(0,NA)) would be a natural way of specifying it. But of course that does not work. I would like to suggest that this possibility should be available. What do people think? Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 05-Feb-09 Time: 20:48:30 ------------------------------ XFMail ------------------------------
on 02/05/2009 02:48 PM (Ted Harding) wrote:> Hi Folks, > Maybe I've missed it already being available somehow, > but if the following isn't available I'd like to suggest it. > > If you're happy to let plot() choose its own limits, > then of course plot(x,y) will do it. > > If you know what limits you want, then > plot(x,y,xlim=c(x0,x1),ylim(y0,y1) > will do it. > > But sometimes one would like to > a) make sure that (e.g.) the y-axis has a lower limit (say) 0 > b) let plot() choose the upper limit. > > In that case, something like > > plot(x,y,ylim=c(0,NA)) > > would be a natural way of specifying it. But of course that > does not work. > > I would like to suggest that this possibility should be available. > What do people think? > > Best wishes, > Ted.Ted, Unless I am mistaken in what you are looking for: plot(x, y, ylim = c(0, max(y))) would seem do what you want. If otherwise unspecified, plot() uses range(y) to define 'ylim'. HTH, Marc Schwartz
On 2/5/2009 3:48 PM, (Ted Harding) wrote:> Hi Folks, > Maybe I've missed it already being available somehow, > but if the following isn't available I'd like to suggest it. > > If you're happy to let plot() choose its own limits, > then of course plot(x,y) will do it. > > If you know what limits you want, then > plot(x,y,xlim=c(x0,x1),ylim(y0,y1) > will do it. > > But sometimes one would like to > a) make sure that (e.g.) the y-axis has a lower limit (say) 0 > b) let plot() choose the upper limit. > > In that case, something like > > plot(x,y,ylim=c(0,NA)) > > would be a natural way of specifying it. But of course that > does not work. > > I would like to suggest that this possibility should be available. > What do people think?I'd rather not assume NA is intentional since there are so many unintentional ways to generate it. Marc told you the simple workaround to get the effect you want. Duncan Murdoch> > Best wishes, > Ted. > > -------------------------------------------------------------------- > E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> > Fax-to-email: +44 (0)870 094 0861 > Date: 05-Feb-09 Time: 20:48:30 > ------------------------------ XFMail ------------------------------ > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Thanks, everyone, for all the responses! Ted. On 05-Feb-09 20:48:33, Ted Harding wrote:> Hi Folks, > Maybe I've missed it already being available somehow, > but if the following isn't available I'd like to suggest it. > > If you're happy to let plot() choose its own limits, > then of course plot(x,y) will do it. > > If you know what limits you want, then > plot(x,y,xlim=c(x0,x1),ylim(y0,y1) > will do it. > > But sometimes one would like to > a) make sure that (e.g.) the y-axis has a lower limit (say) 0 > b) let plot() choose the upper limit. > > In that case, something like > > plot(x,y,ylim=c(0,NA)) > > would be a natural way of specifying it. But of course that > does not work. > > I would like to suggest that this possibility should be available. > What do people think? > > Best wishes, > Ted. > > -------------------------------------------------------------------- > E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> > Fax-to-email: +44 (0)870 094 0861 > Date: 05-Feb-09 Time: 20:48:30 > ------------------------------ XFMail ------------------------------ > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel-------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 05-Feb-09 Time: 23:08:25 ------------------------------ XFMail ------------------------------ -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 06-Feb-09 Time: 00:21:44 ------------------------------ XFMail ------------------------------