1 ## Copyright (C) 1993-2012 John W. Eaton
3 ## This file is part of Octave.
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
20 ## @deftypefn {Function File} {} mesh (@var{x}, @var{y}, @var{z})
21 ## @deftypefnx {Function File} {} mesh (@var{z})
22 ## @deftypefnx {Function File} {} mesh (@dots{}, @var{c})
23 ## @deftypefnx {Function File} {} mesh (@var{hax}, @dots{})
24 ## @deftypefnx {Function File} {@var{h} =} mesh (@dots{})
25 ## Plot a mesh given matrices @var{x}, and @var{y} from @code{meshgrid} and
26 ## a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of
27 ## the mesh. If @var{x} and @var{y} are vectors, then a typical vertex
28 ## is (@var{x}(j), @var{y}(i), @var{z}(i,j)). Thus, columns of @var{z}
29 ## correspond to different @var{x} values and rows of @var{z} correspond
30 ## to different @var{y} values.
32 ## The color of the mesh is derived from the @code{colormap}
33 ## and the value of @var{z}. Optionally the color of the mesh can be
34 ## specified independent of @var{z}, by adding a fourth matrix, @var{c}.
36 ## The optional return value @var{h} is a graphics handle to the created
38 ## @seealso{colormap, contour, meshgrid, surf}
43 function h = mesh (varargin)
47 tmp = surface (varargin{:});
49 ax = get (tmp, "parent");
51 set (tmp, "facecolor", "w");
52 set (tmp, "edgecolor", "flat");
55 set (ax, "view", [-37.5, 30],
56 "xgrid", "on", "ygrid", "on", "zgrid", "on");
66 %% FIXME: Need demo or test for function