7189
|
1 ## Copyright (C) 1996, 1997, 2007 John W. Eaton |
|
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 ## Author: jwe |
|
22 |
|
23 function tmp = __bars__ (h, vertical, x, y, xb, yb, width, group, have_color_spec, varargin) |
|
24 |
|
25 ycols = columns (y); |
|
26 clim = get (h, "clim"); |
|
27 |
|
28 if (vertical) |
|
29 tmp = []; |
7191
|
30 for i = 1:ycols |
7189
|
31 if (! have_color_spec) |
|
32 if (ycols == 1) |
7191
|
33 lev = clim(1); |
7189
|
34 else |
|
35 lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); |
|
36 endif |
|
37 tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), "FaceColor", "flat", |
7208
|
38 "cdata", lev, varargin{:})]; |
7189
|
39 else |
7208
|
40 tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), varargin{:})]; |
7189
|
41 endif |
|
42 endfor |
|
43 else |
|
44 tmp = []; |
7191
|
45 for i = 1:ycols |
7189
|
46 if (! have_color_spec) |
|
47 if (ycols == 1) |
7191
|
48 lev = clim(1) |
7189
|
49 else |
|
50 lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); |
|
51 endif |
|
52 tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), "FaceColor", "flat", |
7208
|
53 "cdata", lev, varargin{:})]; |
7189
|
54 else |
7208
|
55 tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), varargin{:})]; |
7189
|
56 endif |
|
57 endfor |
|
58 endif |
|
59 endfunction |