diff scripts/plot/mesh.m @ 7109:5436efbf35e3

[project @ 2007-11-06 22:16:25 by jwe]
author jwe
date Tue, 06 Nov 2007 22:16:25 +0000
parents a1dbe9d80eee
children 0e63f1126f01
line wrap: on
line diff
--- a/scripts/plot/mesh.m	Tue Nov 06 22:06:27 2007 +0000
+++ b/scripts/plot/mesh.m	Tue Nov 06 22:16:25 2007 +0000
@@ -30,48 +30,15 @@
 
 ## Author: jwe
 
-function h = mesh (x, y, z)
+function h = mesh (varargin)
 
   newplot ();
 
-  if (nargin == 1)
-    z = x;
-    if (ismatrix (z))
-      [nr, nc] = size (z);
-      x = 1:nc;
-      y = (1:nr)';
-    else
-      error ("mesh: argument must be a matrix");
-    endif
-  elseif (nargin == 3)
-    if (isvector (x) && isvector (y) && ismatrix (z))
-      if (rows (z) == length (y) && columns (z) == length (x))
-        x = x(:)';
-        y = y(:);
-      else
-        msg = "mesh: rows (z) must be the same as length (y) and";
-        msg = sprintf ("%s\ncolumns (z) must be the same as length (x)", msg);
-        error (msg);
-      endif
-    elseif (ismatrix (x) && ismatrix (y) && ismatrix (z))
-      if (! (size_equal (x, y) && size_equal (x, z)))
-        error ("mesh: x, y, and z must have same dimensions");
-      endif
-    else
-      error ("mesh: x and y must be vectors and z must be a matrix");
-    endif
-  else
-    print_usage ();
-  endif
-
-  ## make a default line object, and make it the current axes for the
-  ## current figure.
-  ca = gca ();
-
-  tmp = __go_surface__ (ca, "xdata", x, "ydata", y, "zdata", z);
-
-  set (ca, "view", [-37.5, 30]);
-
+  tmp = surface (varargin{:});
+  ax = get(tmp, "parent");
+  set (tmp, "FaceColor", "none");
+  set (tmp, "EdgeColor", "flat");
+  set (ax, "view", [-37.5, 30]);
   if (nargout > 0)
     h = tmp;
   endif