Mercurial > hg > octave-lyh
annotate scripts/plot/__line__.m @ 9110:22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
author | David Bateman <dbateman@free.fr> |
---|---|
date | Sat, 11 Apr 2009 16:26:01 +0200 |
parents | eb63fbe60fab |
children |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2005, 2007, 2008, 2009 John W. Eaton |
6405 | 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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
6405 | 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 | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
6405 | 18 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8078
diff
changeset
|
19 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8078
diff
changeset
|
20 ## @deftypefn {Function File} {@var{h} =} __line__ (@var{p}, @dots{}) |
6895 | 21 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8078
diff
changeset
|
22 ## @end deftypefn |
6895 | 23 |
24 ## __line__ (p, x, y, z) | |
25 ## Create line object from x, y, and z with parent p. | |
6405 | 26 ## Return handle to line object. |
27 | |
28 ## Author: jwe | |
29 | |
30 function h = __line__ (p, varargin) | |
31 | |
32 if (nargin < 1) | |
33 print_usage (); | |
34 endif | |
35 | |
36 nvargs = numel (varargin); | |
37 | |
38 if (nvargs > 1 && isnumeric (varargin{1}) && isnumeric (varargin{2})) | |
39 if (nvargs > 2 && isnumeric (varargin{3})) | |
40 num_data_args = 3; | |
41 else | |
42 num_data_args = 2; | |
43 endif | |
44 else | |
45 num_data_args = 0; | |
46 endif | |
47 | |
8078
4665276ff7f6
correctly plot matrices in plot3
David Bateman <dbateman@free.fr>
parents:
7277
diff
changeset
|
48 if (rem (nvargs - num_data_args, 2) != 0) |
6405 | 49 print_usage ("line"); |
50 endif | |
51 | |
7277 | 52 data_args = {}; |
6405 | 53 if (num_data_args > 1) |
7277 | 54 data_args(1:4) = { "xdata", varargin{1}, "ydata", varargin{2} }; |
6405 | 55 if (num_data_args == 3) |
7277 | 56 data_args(5:6) = { "zdata", varargin{3} }; |
6405 | 57 endif |
58 endif | |
59 | |
7277 | 60 other_args = {}; |
6405 | 61 if (nvargs > num_data_args) |
7277 | 62 other_args = varargin(num_data_args+1:end); |
6405 | 63 endif |
64 | |
7277 | 65 h = __go_line__ (p, data_args{:}, other_args{:}); |
66 | |
6405 | 67 endfunction |