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 |
7325
|
23 function tmp = __bars__ (h, vertical, x, y, xb, yb, width, group, have_color_spec, base_value, varargin) |
|
24 |
|
25 ## Note, base_value is used by the Jhandles backend, which replaces |
|
26 ## this function with its own version. |
7189
|
27 |
|
28 ycols = columns (y); |
|
29 clim = get (h, "clim"); |
|
30 |
|
31 if (vertical) |
|
32 tmp = []; |
7191
|
33 for i = 1:ycols |
7189
|
34 if (! have_color_spec) |
|
35 if (ycols == 1) |
7191
|
36 lev = clim(1); |
7189
|
37 else |
|
38 lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); |
|
39 endif |
|
40 tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), "FaceColor", "flat", |
7208
|
41 "cdata", lev, varargin{:})]; |
7189
|
42 else |
7208
|
43 tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), varargin{:})]; |
7189
|
44 endif |
|
45 endfor |
|
46 else |
|
47 tmp = []; |
7191
|
48 for i = 1:ycols |
7189
|
49 if (! have_color_spec) |
|
50 if (ycols == 1) |
7191
|
51 lev = clim(1) |
7189
|
52 else |
|
53 lev = (i - 1) * (clim(2) - clim(1)) / (ycols - 1) - clim(1); |
|
54 endif |
|
55 tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), "FaceColor", "flat", |
7208
|
56 "cdata", lev, varargin{:})]; |
7189
|
57 else |
7208
|
58 tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), varargin{:})]; |
7189
|
59 endif |
|
60 endfor |
|
61 endif |
|
62 endfunction |