Mercurial > hg > octave-lyh
diff scripts/plot/surfc.m @ 7170:9f38c6293317
[project @ 2007-11-13 17:34:33 by jwe]
author | jwe |
---|---|
date | Tue, 13 Nov 2007 17:34:33 +0000 |
parents | c7e5e638a8d0 |
children | a730e47fda4d |
line wrap: on
line diff
--- a/scripts/plot/surfc.m +++ b/scripts/plot/surfc.m @@ -41,35 +41,17 @@ set (ax, "view", [-37.5, 30]); endif - hold ("on"); - - [c, lev] = contourc (varargin{:}); - - cmap = get (gcf(), "colormap"); - - levx = linspace (min (lev), max (lev), size (cmap, 1)); - - drawnow (); - ax = axis (); - zmin = 2 * ax(5) - ax(6); + if (nargin == 1) + z = varargin {1}; + else + z = varargin {3}; + endif + zmin = 2 * (min(z(:)) - max(z(:))); - ## decode contourc output format - i1 = 1; - while (i1 < length (c)) - - clev = c(1,i1); - clen = c(2,i1); + [c, tmp2] = __contour__ (ax, zmin, varargin{:}); - ccr = interp1 (levx, cmap(:,1), clev); - ccg = interp1 (levx, cmap(:,2), clev); - ccb = interp1 (levx, cmap(:,3), clev); + tmp = [tmp; tmp2]; - ii = i1+1:i1+clen; - line (c(1,ii), c(2,ii), zmin*ones(size(ii)), "color", [ccr, ccg, ccb]); - - i1 += c(2,i1)+1; - endwhile - if (nargout > 0) h = tmp; endif