Mercurial > hg > octave-avbm
changeset 595:a0cc17145462
[project @ 1994-08-09 18:42:23 by jwe]
author | jwe |
---|---|
date | Tue, 09 Aug 1994 18:42:23 +0000 |
parents | 45172f0adca5 |
children | 07e689d6e7e5 |
files | scripts/plot/axis.m |
diffstat | 1 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/plot/axis.m +++ b/scripts/plot/axis.m @@ -18,20 +18,25 @@ function axis (ax) -# usage: axis ([xmin, xmax]) +# usage: axis () +# axis ([xmin, xmax]) # axis ([xmin, xmax, ymin, ymax]) # axis ([xmin, xmax, ymin, ymax, zmin, zmax]) # # Sets the axis limits. # +# With no arguments, turns autoscaling on. +# # If your plot is already drawn, then you need to REPLOT before # the new axis limits will take effect. - if (nargin != 1) + if (nargin > 1) error ("usage: axis ([xmin, xmax, ymin, ymax, zmin, zmax])"); endif - if (is_vector (ax)) + if (nargin == 0) + set autoscale; + elseif (is_vector (ax)) len = length (ax); @@ -52,7 +57,7 @@ endif else - error ("axis: expecting vector with 2, 4, or 6 elements"); + error ("axis: expecting no args, or a vector with 2, 4, or 6 elements"); endif endfunction