annotate scripts/plot/__bar__.m @ 7148:735086cfd405

[project @ 2007-11-09 18:01:44 by jwe]
author jwe
date Fri, 09 Nov 2007 18:01:45 +0000
parents 258dd5c9bfe0
children e8d953d03f6a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
1 ## Copyright (C) 1996, 1997, 2007 John W. Eaton
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
2 ##
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
3 ## This file is part of Octave.
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
4 ##
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
8 ## your option) any later version.
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
9 ##
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
13 ## General Public License for more details.
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
14 ##
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6895
diff changeset
17 ## <http://www.gnu.org/licenses/>.
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
18
6895
76e3d985ae56 [project @ 2007-09-13 18:22:38 by jwe]
jwe
parents: 6886
diff changeset
19 ## Undocumented internal function.
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
20
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
21 ## Author: jwe
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
22
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
23 function varargout = __bar__ (vertical, func, varargin)
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
24
7148
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
25 ## Slightly smaller than 0.8 to avoid clipping issue in gnuplot 4.0
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
26 width = 0.8 - 10 * eps;
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
27 group = true;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
28
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
29 if (nargin < 3)
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
30 print_usage ();
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
31 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
32
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
33 if (nargin > 3 && isnumeric (varargin{2}))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
34 x = varargin{1};
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
35 if (isvector (x))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
36 x = x(:);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
37 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
38 y = varargin{2};
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
39 if (isvector (y))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
40 y = y(:);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
41 endif
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
42 if (size (x, 1) != size (y, 1))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
43 y = varargin{1};
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
44 if (isvector (y))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
45 y = y(:);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
46 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
47 x = [1:size(y,1)]';
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
48 idx = 2;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
49 else
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
50 if (! isvector (x))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
51 error ("%s: x must be a vector", func);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
52 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
53 idx = 3;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
54 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
55 else
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
56 y = varargin{1};
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
57 if (isvector (y))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
58 y = y(:);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
59 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
60 x = [1:size(y,1)]';
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
61 idx = 2;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
62 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
63
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
64 newargs = {};
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
65 have_line_spec = false;
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
66 while (idx <= nargin -2)
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
67 if (isstr (varargin{idx}) && strcmp (varargin{idx}, "grouped"))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
68 group = true;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
69 idx++;
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
70 elseif (isstr (varargin{idx}) && strcmp (varargin{idx}, "stacked"))
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
71 group = false;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
72 idx++;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
73 else
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
74 if ((isstr (varargin{idx}) || iscell (varargin{idx}))
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
75 && ! have_line_spec)
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
76 [linespec, valid] = __pltopt__ (func, varargin{idx}, false);
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
77 if (valid)
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
78 have_line_spec = true;
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
79 newargs = [{linespec.color}, newargs];
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
80 idx++;
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
81 continue;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
82 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
83 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
84 if (isscalar(varargin{idx}))
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
85 width = varargin{idx++};
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
86 elseif (idx == nargin - 2)
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
87 newargs = [newargs,varargin(idx++)];
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
88 else
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
89 newargs = [newargs,varargin(idx:idx+1)];
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
90 idx += 2;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
91 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
92 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
93 endwhile
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
94
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
95 xlen = size (x, 1);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
96 ylen = size (y, 1);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
97
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
98 if (xlen != ylen)
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
99 error ("%s: length of x and y must be equal", func)
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
100 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
101 if (any (x(2:end) < x(1:end-1)))
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
102 error ("%s: x vector values must be in ascending order", func);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
103 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
104
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
105 ycols = size (y, 2);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
106 if (group)
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
107 width = width / ycols;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
108 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
109
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
110 cutoff = (x(1:end-1) + x(2:end)) / 2;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
111 delta_p = [(cutoff - x(1:end-1)); (x(end) - cutoff(end))] * width;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
112 delta_m = [(cutoff(1) - x(1)); (x(2:end) - cutoff)] * width;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
113 x1 = (x - delta_m)(:)';
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
114 x2 = (x + delta_p)(:)';
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
115 xb = repmat ([x1; x1; x2; x2](:), 1, ycols);
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
116
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
117 if (group)
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
118 width = width / ycols;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
119 offset = ((delta_p + delta_m) * [-(ycols - 1) / 2 : (ycols - 1) / 2]);
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
120 xb(1:4:4*ylen,:) += offset;
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
121 xb(2:4:4*ylen,:) += offset;
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
122 xb(3:4:4*ylen,:) += offset;
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
123 xb(4:4:4*ylen,:) += offset;
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
124 y0 = zeros (size (y));
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
125 y1 = y;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
126 else
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
127 y1 = cumsum(y,2);
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
128 y0 = [zeros(ylen,1), y1(:,1:end-1)];
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
129 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
130
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
131 yb = zeros (4*ylen, ycols);
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
132 yb(1:4:4*ylen,:) = y0;
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
133 yb(2:4:4*ylen,:) = y1;
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
134 yb(3:4:4*ylen,:) = y1;
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
135 yb(4:4:4*ylen,:) = y0;
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
136
7148
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
137 xb = reshape (xb, [4, numel(xb) / 4 / ycols, ycols]);
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
138 yb = reshape (yb, [4, numel(yb) / 4 / ycols, ycols]);
6885
987a7bf45c99 [project @ 2007-09-10 20:51:09 by jwe]
jwe
parents: 6633
diff changeset
139
7148
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
140 color = [1, 0, 0; 0, 1, 0; 0, 0, 1; 1, 1, 0; 1, 0, 1; 0, 1, 1];
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
141 if (vertical)
7148
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
142 if (nargout < 2)
7039
258dd5c9bfe0 [project @ 2007-10-19 16:12:04 by jwe]
jwe
parents: 7017
diff changeset
143 newplot ();
7148
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
144 tmp = [];
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
145 for i = 1 : ycols
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
146 if (! have_line_spec)
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
147 tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), color(i,:), newargs {:})];
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
148 else
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
149 tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), newargs {:})];
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
150 endif
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
151 endfor
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
152 if (nargout == 1)
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
153 varargout{1} = tmp;
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
154 endif
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
155 else
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
156 varargout{1} = xb;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
157 varargout{2} = yb;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
158 endif
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
159 else
7148
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
160 if (nargout < 2)
7039
258dd5c9bfe0 [project @ 2007-10-19 16:12:04 by jwe]
jwe
parents: 7017
diff changeset
161 newplot ();
7148
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
162 tmp = [];
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
163 for i = 1 : ycols
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
164 if (! have_line_spec)
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
165 tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), color(i,:), newargs {:})];
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
166 else
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
167 tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), newargs {:})];
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
168 endif
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
169 endfor
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
170 if (nargout == 1)
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
171 varargout{1} = tmp;
735086cfd405 [project @ 2007-11-09 18:01:44 by jwe]
jwe
parents: 7039
diff changeset
172 endif
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
173 else
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
174 varargout{1} = yb;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
175 varargout{2} = xb;
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
176 endif
6886
1c1d62569590 [project @ 2007-09-10 20:58:34 by jwe]
jwe
parents: 6885
diff changeset
177 endif
6540
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
178
9dcfc78da664 [project @ 2007-04-18 21:16:08 by dbateman]
dbateman
parents:
diff changeset
179 endfunction