Mercurial > hg > octave-lyh
diff scripts/plot/pcolor.m @ 7110:0e63f1126f01
[project @ 2007-11-06 22:36:22 by jwe]
author | jwe |
---|---|
date | Tue, 06 Nov 2007 22:36:22 +0000 |
parents | 5436efbf35e3 |
children | c7e5e638a8d0 |
line wrap: on
line diff
--- a/scripts/plot/pcolor.m +++ b/scripts/plot/pcolor.m @@ -1,6 +1,4 @@ - -## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2004, -## 2005, 2006, 2007 John W. Eaton +## Copyright (C) 2007 Kai Habel ## ## This file is part of Octave. ## @@ -30,28 +28,31 @@ ## @seealso{meshgrid, contour} ## @end deftypefn -## Author: jwe +## Author: Kai Habel <kai.habel@gmx.de> -function h = pcolor (x,y,c) +function h = pcolor (x, y, c) newplot (); if (nargin == 1) - C = x; - Z = zeros(size(C)); - [nr, nc] = size(C); - [X, Y] = meshgrid(1:nr, 1:nc); + c = x; + z = zeros (size (c)); + [nr, nc] = size (c); + [x, y] = meshgrid (1:nr, 1:nc); elseif (nargin == 3) - Z = zeros(size(C)); + z = zeros (size (c)); else - print_usage(); - end; + print_usage (); + endif + tmp = surface (X, Y, Z, c); - tmp = surface (X,Y,Z,C); - ax = get(tmp, "parent"); - set (tmp, "FaceColor", "flat"); + ax = get (tmp, "parent"); + + set (tmp, "facecolor", "flat"); + set (ax, "view", [0, 90]); + if (nargout > 0) h = tmp; endif