7146
|
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) |
7147
|
22 |
7146
|
23 colors = [1, 0, 0; 0, 1, 0; 0, 0, 1; 1, 1, 0; 1, 0, 1; 0, 1, 1]; |
7147
|
24 |
|
25 x = [x(1,:); x; x(end,:)]; |
|
26 |
|
27 y = cumsum ([[bv, ones(1, size (y, 2) - 1)]; y; |
7146
|
28 [bv, ones(1, size (y, 2) - 1)]], 2); |
|
29 |
7147
|
30 retval = patch (ax, x(:,1), y(:,1), colors(1,:), varargin{:}); |
|
31 |
|
32 for i = 2:size(y,2) |
|
33 tmp = patch (ax, [x(:,i); flipud(x(:,i))], |
|
34 [y(:,i) ; flipud(y(:, i-1))], colors(i,:), varargin{:}); |
|
35 |
|
36 retval = [retval; tmp]; |
7146
|
37 endfor |
7147
|
38 |
7146
|
39 endfunction |