From: <pki...@pr...> - 2004-01-27 00:14:04
|
Update of /cvsroot/octave/octave-forge/main/plot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3029/main/plot Modified Files: legend.m plot3.m Log Message: nargin is now a function, so don't use it as a variable Index: legend.m =================================================================== RCS file: /cvsroot/octave/octave-forge/main/plot/legend.m,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- legend.m 25 Jul 2003 19:11:41 -0000 1.8 +++ legend.m 27 Jan 2004 00:13:08 -0000 1.9 @@ -85,19 +85,23 @@ ## PKG_ADD mark_as_command legend function legend (varargin) + ## Use the following for 2.1.39 and below + # varargin = list(varargin, all_va_args); + args = nargin; # silliness: nargin is now a function + ## Data type data_type = 0; va_arg_cnt = 1; str = ""; - if (nargin > 0) + if (args > 0) str = nth (varargin, va_arg_cnt++); endif; ## Test for strings - if (isstr(str)) && (nargin == 1) + if (isstr(str)) && (args == 1) _str = tolower(deblank(str)); _replot = 1; switch _str @@ -134,7 +138,7 @@ data = cellstr( nth (varargin, va_arg_cnt++)); endif nb_data = length(data); - nargin--; + args--; endif; pos_leg = 1; @@ -212,13 +216,13 @@ ## Get the legend string - if (((data_type == 0) && (nargin <= 0)) || \ + if (((data_type == 0) && (args <= 0)) || \ ((data_type == 1) && (fig >= nb_data))) leg = "\"\""; else if (data_type == 0) leg = nth (varargin, va_arg_cnt++); - nargin--; + args--; else leg = data{fig+1}; endif; @@ -262,7 +266,7 @@ ## Check for the last argument if we don't already get it - while (nargin-- > 0) + while (args-- > 0) pos_leg = nth (varargin, va_arg_cnt++) ; if (isstr(pos_leg)) pos_leg = 0; Index: plot3.m =================================================================== RCS file: /cvsroot/octave/octave-forge/main/plot/plot3.m,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- plot3.m 4 Nov 2002 10:28:09 -0000 1.3 +++ plot3.m 27 Jan 2004 00:13:08 -0000 1.4 @@ -39,6 +39,9 @@ function plot3(varargin) + ## use the following for 2.1.38 and below + # varargin = list(varargin, all_va_args); + hold_state = ishold (); unwind_protect @@ -48,11 +51,8 @@ z_set = 0; ## Gather arguments, decode format, and plot lines. - - va_arg_cnt = 1; - while (nargin-- > 0) - - new = nth (varargin, va_arg_cnt++); + for arg = 1:length(varargin) + new = nth (varargin, arg); if (isstr (new)) if (! z_set) |