7109
|
1 |
|
2 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2004, |
|
3 ## 2005, 2006, 2007 John W. Eaton |
|
4 ## |
|
5 ## This file is part of Octave. |
|
6 ## |
|
7 ## Octave is free software; you can redistribute it and/or modify it |
|
8 ## under the terms of the GNU General Public License as published by |
|
9 ## the Free Software Foundation; either version 3 of the License, or (at |
|
10 ## your option) any later version. |
|
11 ## |
|
12 ## Octave is distributed in the hope that it will be useful, but |
|
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 ## General Public License for more details. |
|
16 ## |
|
17 ## You should have received a copy of the GNU General Public License |
|
18 ## along with Octave; see the file COPYING. If not, see |
|
19 ## <http://www.gnu.org/licenses/>. |
|
20 |
|
21 ## -*- texinfo -*- |
|
22 ## @deftypefn {Function File} {} surf (@var{x}, @var{y}, @var{z}) |
|
23 ## Plot a surface given matrices @var{x}, and @var{y} from @code{meshgrid} and |
|
24 ## a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of |
|
25 ## the mesh. If @var{x} and @var{y} are vectors, then a typical vertex |
|
26 ## is (@var{x}(j), @var{y}(i), @var{z}(i,j)). Thus, columns of @var{z} |
|
27 ## correspond to different @var{x} values and rows of @var{z} correspond |
|
28 ## to different @var{y} values. |
|
29 ## @seealso{mesh, surface} |
|
30 ## @end deftypefn |
|
31 |
|
32 ## Author: jwe |
|
33 |
|
34 function h = surf (varargin) |
|
35 |
|
36 newplot (); |
|
37 |
|
38 tmp = surface (varargin{:}); |
|
39 ax = get(tmp, "parent"); |
|
40 set (tmp, "FaceColor", "flat"); |
|
41 set (ax, "view", [-37.5, 30]); |
|
42 if (nargout > 0) |
|
43 h = tmp; |
|
44 endif |
|
45 |
|
46 endfunction |