7110
|
1 ## Copyright (C) 2007 Kai Habel |
7109
|
2 ## |
|
3 ## This file is part of Octave. |
|
4 ## |
|
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. |
|
9 ## |
|
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. |
|
14 ## |
|
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/>. |
|
18 |
|
19 ## -*- texinfo -*- |
|
20 ## @deftypefn {Function File} {} surf (@var{x}, @var{y}, @var{z}) |
|
21 ## Plot a surface given matrices @var{x}, and @var{y} from @code{meshgrid} and |
|
22 ## a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of |
|
23 ## the mesh. If @var{x} and @var{y} are vectors, then a typical vertex |
|
24 ## is (@var{x}(j), @var{y}(i), @var{z}(i,j)). Thus, columns of @var{z} |
|
25 ## correspond to different @var{x} values and rows of @var{z} correspond |
|
26 ## to different @var{y} values. |
|
27 ## @seealso{mesh, surface} |
|
28 ## @end deftypefn |
|
29 |
7110
|
30 ## Author: Kai Habel <kai.habel@gmx.de> |
7109
|
31 |
|
32 function h = surf (varargin) |
|
33 |
|
34 newplot (); |
|
35 |
|
36 tmp = surface (varargin{:}); |
7110
|
37 |
|
38 ax = get (tmp, "parent"); |
|
39 |
|
40 set (tmp, "facecolor", "flat"); |
7146
|
41 if (! ishold ()) |
|
42 set (ax, "view", [-37.5, 30]); |
|
43 endif |
7110
|
44 |
7109
|
45 if (nargout > 0) |
|
46 h = tmp; |
|
47 endif |
|
48 |
|
49 endfunction |