Mercurial > hg > octave-lyh
diff scripts/plot/surfc.m @ 12858:6ceca9beb331
surfc.m: Don't pass color matrix to contour. Bug #33782
author | Kai Habel <kai.habel@gmx.de> |
---|---|
date | Sun, 17 Jul 2011 21:06:18 +0200 |
parents | b0084095098e |
children | b00181c65533 |
line wrap: on
line diff
--- a/scripts/plot/surfc.m +++ b/scripts/plot/surfc.m @@ -45,7 +45,26 @@ drawnow (); zmin = get (ax, "zlim")(1); - [c, tmp2] = __contour__ (ax, zmin, varargin{:}); + # don't pass axis handle and/or string arguments to __contour__() + stop_idx = nargin; + for i = 2 : nargin + if (ischar (varargin{i})) + stop_idx = i - 1; + break; + endif + endfor + + start_idx = 1; + if (ishandle (varargin{1})) + start_idx = 2; + endif + + if (stop_idx - start_idx == 1 || stop_idx - start_idx == 3) + #don't pass a color matrix c to __contour__ + stop_idx -= 1; + endif + + [c, tmp2] = __contour__ (ax, zmin, varargin{start_idx:stop_idx}); tmp = [tmp; tmp2];