# HG changeset patch # User jwe # Date 815378247 0 # Node ID 26a096727e8958e106a232af1cd1cc65b2dba95f # Parent d0a45cb55b59e5fc61cb5f2c36e4e1c06798940c [project @ 1995-11-03 05:57:27 by jwe] diff -r d0a45cb55b59 -r 26a096727e89 scripts/plot/axis.m --- a/scripts/plot/axis.m Fri Nov 03 05:41:37 1995 +0000 +++ b/scripts/plot/axis.m Fri Nov 03 05:57:27 1995 +0000 @@ -16,7 +16,7 @@ # along with Octave; see the file COPYING. If not, write to the Free # Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -function axis (ax) +function curr_axis = axis (ax) # usage: axis () # axis ([xmin, xmax]) @@ -30,12 +30,22 @@ # If your plot is already drawn, then you need to REPLOT before # the new axis limits will take effect. +# This may not be correct if someone has used the gnuplot interface +# directly... + + global __current_axis__; + + if (! exist ("__current_axis__")) + __current_axis__ = [-10, 10, -10, 10]; + endif + if (nargin > 1) usage ("axis ([xmin, xmax, ymin, ymax, zmin, zmax])"); endif if (nargin == 0) set autoscale; + curr_axis = __current_axis__; elseif (is_vector (ax)) len = length (ax); @@ -44,6 +54,8 @@ error ("axis: expecting vector with 2, 4, or 6 elements"); endif + __current_axis__ = reshape (ax, 1, len); + if (len > 1) eval (sprintf ("set xrange [%g:%g];", ax (1), ax (2))); endif