# HG changeset patch # User Kai Habel # Date 1310929578 -7200 # Node ID 6ceca9beb3313d1261ad77a8e98076477d1b3728 # Parent 4061a9ec9c405dc0daa1db7c590f289f933521fc surfc.m: Don't pass color matrix to contour. Bug #33782 diff --git a/scripts/plot/surfc.m b/scripts/plot/surfc.m --- 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];