Mercurial > octave-nkf
annotate scripts/plot/draw/private/__patch__.m @ 19867:9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Try to trim long lines to < 80 chars.
Use '##' for single line comments.
Use '(...)' around tests for if/elseif/switch/while.
Abut cell indexing operator '{' next to variable.
Abut array indexing operator '(' next to variable.
Use space between negation operator '!' and following expression.
Use two newlines between endfunction and start of %!test or %!demo code.
Remove unnecessary parens grouping between short-circuit operators.
Remove stray extra spaces (typos) between variables and assignment operators.
Remove stray extra spaces from ends of lines.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 23 Feb 2015 14:54:39 -0800 |
parents | 4197fc428c7d |
children | 85dcbed19753 |
rev | line source |
---|---|
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19630
diff
changeset
|
1 ## Copyright (C) 2007-2015 John W. Eaton, Shai Ayal, Kai Habel |
6807 | 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. | |
6807 | 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/>. | |
6807 | 18 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8190
diff
changeset
|
19 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
8190
diff
changeset
|
20 ## @deftypefn {Function File} {[@var{h}, @var{fail}] =} __patch__ (@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:
8190
diff
changeset
|
22 ## @end deftypefn |
6895 | 23 |
24 ## __patch__ (p, x, y, c) | |
25 ## Create patch object from x and y with color c and parent p. | |
6807 | 26 ## Return handle to patch object. |
27 | |
28 ## Author: Kai Habel | |
29 | |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
30 function [h, failed] = __patch__ (p, varargin) |
7191 | 31 |
13954
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
32 h = NaN; |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
33 failed = false; |
6885 | 34 |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
35 is_numeric_arg = cellfun (@isnumeric, varargin); |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
36 |
13115
cd808de114c1
Allow surface and patch to be called w/o arguments. Adding and fixing tests.
Kai Habel <kai.habel@gmx.de>
parents:
12931
diff
changeset
|
37 if (isempty (varargin)) |
18935
df972b9d080a
Translate patch property listeners to C++ (bug #42159)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
18928
diff
changeset
|
38 args = varargin; |
13115
cd808de114c1
Allow surface and patch to be called w/o arguments. Adding and fixing tests.
Kai Habel <kai.habel@gmx.de>
parents:
12931
diff
changeset
|
39 elseif (isstruct (varargin{1})) |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
40 if (isfield (varargin{1}, "vertices") && isfield (varargin{1}, "faces")) |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
41 args{1} = "faces"; |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14552
diff
changeset
|
42 args{2} = getfield (varargin{1}, "faces"); |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
43 args{3} = "vertices"; |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14552
diff
changeset
|
44 args{4} = getfield (varargin{1}, "vertices"); |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
45 args{5} = "facevertexcdata"; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
46 if (isfield (varargin{1}, "facevertexcdata")) |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14552
diff
changeset
|
47 args{6} = getfield (varargin{1}, "facevertexcdata"); |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
48 else |
10549 | 49 args{6} = []; |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
50 endif |
19381
2da8f0c6e8a3
__patch__.m: Fix incorrect concatenation of input args (bug #43670).
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
51 args = [args, varargin(2:end)]; |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
52 else |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
53 failed = true; |
7020 | 54 endif |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
55 elseif (is_numeric_arg(1)) |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
56 if (nargin < 3 || ! is_numeric_arg(2)) |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
57 failed = true; |
7020 | 58 else |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
59 if (nargin > 4 && all (is_numeric_arg(1:4))) |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
60 x = varargin{1}; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
61 y = varargin{2}; |
10549 | 62 z = varargin{3}; |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
63 c = varargin{4}; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
64 iarg = 5; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
65 elseif (nargin > 3 && all (is_numeric_arg(1:3))) |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
66 x = varargin{1}; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
67 y = varargin{2}; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
68 iarg = 4; |
13308
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
69 if (rem (nargin - iarg, 2) == 1) |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
70 c = varargin{iarg}; |
13308
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
71 z = varargin{3}; |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
72 iarg = 5; |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
73 else |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
74 z = []; |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
75 c = varargin{3}; |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
76 endif |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
77 elseif (nargin > 2 && all (is_numeric_arg(1:2))) |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
78 x = varargin{1}; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
79 y = varargin{2}; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
80 z = []; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
81 iarg = 3; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
82 if (rem (nargin - iarg, 2) == 1) |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
83 c = varargin{iarg}; |
19627
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19381
diff
changeset
|
84 iarg++; |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
85 else |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
86 c = []; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
87 endif |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
88 endif |
6885 | 89 |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
90 if (isvector (x)) |
10549 | 91 x = x(:); |
92 y = y(:); | |
93 z = z(:); | |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
94 if (isnumeric (c)) |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
95 if (isvector (c) && numel (c) == numel (x)) |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
96 c = c(:); |
14872
c2dbdeaa25df
maint: use rows() and columns() to clarify m-files.
Rik <octave@nomad.inbox5.com>
parents:
14868
diff
changeset
|
97 elseif (rows (c) != numel (x) && columns (c) == numel (x)) |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
98 c = c.'; |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
99 endif |
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
100 endif |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
101 endif |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
102 args{1} = "xdata"; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
103 args{2} = x; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
104 args{3} = "ydata"; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
105 args{4} = y; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
106 args{5} = "zdata"; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
107 args{6} = z; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
108 |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
109 if (isnumeric (c)) |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
110 |
14872
c2dbdeaa25df
maint: use rows() and columns() to clarify m-files.
Rik <octave@nomad.inbox5.com>
parents:
14868
diff
changeset
|
111 if (ndims (c) == 3 && columns (c) == 1) |
10549 | 112 c = permute (c, [1, 3, 2]); |
113 endif | |
6885 | 114 |
10549 | 115 if (isvector (c) && numel (c) == columns (x)) |
116 if (isnan (c)) | |
117 args{7} = "facecolor"; | |
118 args{8} = [1, 1, 1]; | |
119 args{9} = "cdata"; | |
120 args{10} = c; | |
121 elseif (isnumeric (c)) | |
122 args{7} = "facecolor"; | |
123 args{8} = "flat"; | |
124 args{9} = "cdata"; | |
125 args{10} = c; | |
126 else | |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
127 error ("patch: color data C must be numeric"); |
10549 | 128 endif |
13954
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
129 elseif (isvector (c) && numel (c) == 3) |
10549 | 130 args{7} = "facecolor"; |
13808
d5bfaa582eaa
correctly handle RGB color spec for patch object
John W. Eaton <jwe@octave.org>
parents:
13779
diff
changeset
|
131 args{8} = c; |
10549 | 132 args{9} = "cdata"; |
13808
d5bfaa582eaa
correctly handle RGB color spec for patch object
John W. Eaton <jwe@octave.org>
parents:
13779
diff
changeset
|
133 args{10} = []; |
13954
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
134 elseif (ndims (c) == 3 && size (c, 3) == 3) |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
135 ## CDATA is specified as RGB data |
14872
c2dbdeaa25df
maint: use rows() and columns() to clarify m-files.
Rik <octave@nomad.inbox5.com>
parents:
14868
diff
changeset
|
136 if ((rows (c) == 1 && columns (c) == 1) ... |
c2dbdeaa25df
maint: use rows() and columns() to clarify m-files.
Rik <octave@nomad.inbox5.com>
parents:
14868
diff
changeset
|
137 || (rows (c) == 1 && columns (c) == columns (x))) |
13954
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
138 ## Single patch color or per-face color |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
139 args{7} = "facecolor"; |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
140 args{8} = "flat"; |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
141 args{9} = "cdata"; |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
142 args{10} = c; |
14872
c2dbdeaa25df
maint: use rows() and columns() to clarify m-files.
Rik <octave@nomad.inbox5.com>
parents:
14868
diff
changeset
|
143 elseif (rows (c) == rows (x) && columns (c) == columns (x)) |
13954
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
144 ## Per-vertex color |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
145 args{7} = "facecolor"; |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
146 args{8} = "interp"; |
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
147 args{9} = "cdata"; |
17347
1391dc953ae2
__patch__.m: Fix typo and close bug #34417.
Rik <rik@octave.org>
parents:
17338
diff
changeset
|
148 args{10} = c; |
13954
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
149 else |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
150 error ("patch: Invalid TrueColor data C"); |
13954
2ebbc6c9961b
[Bug #34559] Clean-up __patch__.m and add support for RGB cdata.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13809
diff
changeset
|
151 endif |
10549 | 152 else |
153 ## Color Vectors | |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
154 if (isempty (c)) |
10549 | 155 args{7} = "facecolor"; |
156 args{8} = "interp"; | |
157 args{9} = "cdata"; | |
158 args{10} = []; | |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
159 elseif (size_equal (c, x) && size_equal (c, y)) |
13308
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
160 args{7} = "facecolor"; |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
161 args{8} = "interp"; |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
162 args{9} = "cdata"; |
9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
Ben Abbott <bpabbott@mac.com>
parents:
13299
diff
changeset
|
163 args{10} = c; |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
164 else |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
165 error ("patch: size of X, Y, and C must be equal"); |
10549 | 166 endif |
167 endif | |
13299
e9f6a6edec42
Improvements to patch() and fix for bugs reported in #34417.
Ben Abbott <bpabbott@mac.com>
parents:
13256
diff
changeset
|
168 elseif (ischar (c) && rem (nargin - iarg, 2) == 0) |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
169 ## Assume any additional argument over an even number is a color string. |
10549 | 170 args{7} = "facecolor"; |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
171 args{8} = tolower (c); |
10549 | 172 args{9} = "cdata"; |
173 args{10} = []; | |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
174 else |
10549 | 175 args{7} = "facecolor"; |
18928
24332f256940
Set default patch color to black rather than green for Matlab compatibility.
Rik <rik@octave.org>
parents:
18307
diff
changeset
|
176 args{8} = [0, 0, 0]; |
10549 | 177 args{9} = "cdata"; |
178 args{10} = []; | |
6925 | 179 endif |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
180 |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
181 args = [args, varargin(iarg:end)]; |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
182 endif |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
183 else |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
184 args = varargin; |
6885 | 185 endif |
186 | |
19867
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19731
diff
changeset
|
187 if (! failed) |
18307
a97ed15d1ea8
__patch__.m: Follow Octave coding conventions.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
188 h = __go_patch__ (p, args{:}); |
9110
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
189 endif |
22ae6b3411a7
Add isocolor, isonormals and isosurface functions (For Martin Helm). Add 3D filled triangular patches and the trisurf function
David Bateman <dbateman@free.fr>
parents:
8920
diff
changeset
|
190 endfunction |