1 ## Copyright (C) 1996-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} {} meshc (@var{x}, @var{y}, @var{z})
21 ## Plot a mesh and contour given matrices @var{x}, and @var{y} from
22 ## @code{meshgrid} and a matrix @var{z} corresponding to the @var{x} and
23 ## @var{y} coordinates of the mesh. If @var{x} and @var{y} are vectors,
24 ## then a typical vertex is (@var{x}(j), @var{y}(i), @var{z}(i,j)). Thus,
25 ## columns of @var{z} correspond to different @var{x} values and rows of
26 ## @var{z} correspond to different @var{y} values.
27 ## @seealso{meshgrid, mesh, contour}
30 function h = meshc (varargin)
34 tmp = surface (varargin{:});
36 ax = get (tmp, "parent");
38 set (tmp, "facecolor", "w");
39 set (tmp, "edgecolor", "flat");
40 ## FIXME - gnuplot does not support a filled surface and a
41 ## non-filled contour. 3D filled patches are also not supported.
42 ## Thus, the facecolor will be transparent for the gnuplot
46 set (ax, "view", [-37.5, 30],
47 "xgrid", "on", "ygrid", "on", "zgrid", "on");
51 zmin = get (ax, "zlim")(1);
53 [c, tmp2] = __contour__ (ax, zmin, varargin{:});