comparison scripts/plot/__area__.m @ 7146:c7e5e638a8d0

[project @ 2007-11-09 17:49:44 by jwe]
author jwe
date Fri, 09 Nov 2007 17:51:42 +0000
parents
children fdb3840cec66
comparison
equal deleted inserted replaced
7145:d169c9f4a697 7146:c7e5e638a8d0
1 ## Copyright (C) 2007 David Bateman
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 ## Undocumented internal function.
20
21 function retval = __area__ (ax, x, y, bv, varargin)
22 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 y = cumsum ([[bv, ones(1, size (y, 2) - 1)] ; y ; ...
25 [bv, ones(1, size (y, 2) - 1)]], 2);
26
27 retval = patch (ax, x(:, 1), y (:, 1), colors (1,:), varargin{:});
28 for i = 2 : size(y, 2)
29 retval = [retval; patch(ax, [x(:,i); flipud(x(:,i))], ...
30 [y(:, i) ; flipud(y(:, i-1))], colors(i,:),
31 varargin{:})];
32 endfor
33 endfunction