comparison scripts/plot/__area__.m @ 7147:fdb3840cec66

[project @ 2007-11-09 17:56:34 by jwe]
author jwe
date Fri, 09 Nov 2007 17:56:34 +0000
parents c7e5e638a8d0
children 9a6f4713f765
comparison
equal deleted inserted replaced
7146:c7e5e638a8d0 7147:fdb3840cec66
17 ## <http://www.gnu.org/licenses/>. 17 ## <http://www.gnu.org/licenses/>.
18 18
19 ## Undocumented internal function. 19 ## Undocumented internal function.
20 20
21 function retval = __area__ (ax, x, y, bv, varargin) 21 function retval = __area__ (ax, x, y, bv, varargin)
22
22 colors = [1, 0, 0; 0, 1, 0; 0, 0, 1; 1, 1, 0; 1, 0, 1; 0, 1, 1]; 23 colors = [1, 0, 0; 0, 1, 0; 0, 0, 1; 1, 1, 0; 1, 0, 1; 0, 1, 1];
23 x = [x(1,:) ; x ; x(end,:)]; 24
24 y = cumsum ([[bv, ones(1, size (y, 2) - 1)] ; y ; ... 25 x = [x(1,:); x; x(end,:)];
26
27 y = cumsum ([[bv, ones(1, size (y, 2) - 1)]; y;
25 [bv, ones(1, size (y, 2) - 1)]], 2); 28 [bv, ones(1, size (y, 2) - 1)]], 2);
26 29
27 retval = patch (ax, x(:, 1), y (:, 1), colors (1,:), varargin{:}); 30 retval = patch (ax, x(:,1), y(:,1), colors(1,:), varargin{:});
28 for i = 2 : size(y, 2) 31
29 retval = [retval; patch(ax, [x(:,i); flipud(x(:,i))], ... 32 for i = 2:size(y,2)
30 [y(:, i) ; flipud(y(:, i-1))], colors(i,:), 33 tmp = patch (ax, [x(:,i); flipud(x(:,i))],
31 varargin{:})]; 34 [y(:,i) ; flipud(y(:, i-1))], colors(i,:), varargin{:});
35
36 retval = [retval; tmp];
32 endfor 37 endfor
38
33 endfunction 39 endfunction