# HG changeset patch # User jwe # Date 776457743 0 # Node ID a0cc17145462c0a0b75b05c136c4a3be780af07c # Parent 45172f0adca5b7441cd9d277fca6d70b6d6e84f6 [project @ 1994-08-09 18:42:23 by jwe] diff --git a/scripts/plot/axis.m b/scripts/plot/axis.m --- 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