2847
|
1 ## Copyright (C) 1996, 1997 John W. Eaton |
2313
|
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 |
7016
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
|
8 ## your option) any later version. |
2313
|
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 |
7016
|
16 ## along with Octave; see the file COPYING. If not, see |
|
17 ## <http://www.gnu.org/licenses/>. |
245
|
18 |
3368
|
19 ## -*- texinfo -*- |
6540
|
20 ## @deftypefn {Function File} {@var{h} =} bar (@var{x}, @var{y}, @var{style}) |
|
21 ## @deftypefnx {Function File} {[@var{xb}, @var{yb}] =} bar (@dots{}) |
6895
|
22 ## Given two vectors of x-y data, @code{bar} produce a bar graph. |
3426
|
23 ## |
2311
|
24 ## If only one argument is given, it is taken as a vector of y-values |
|
25 ## and the x coordinates are taken to be the indices of the elements. |
3426
|
26 ## |
6540
|
27 ## If @var{y} is a matrix, then each column of @var{y} is taken to be a |
|
28 ## separate bar graph plotted on the same graph. By default the columns |
|
29 ## are plotted side-by-side. This behavior can be changed by the @var{style} |
|
30 ## argument, which can take the values 'group' (the default), or 'stack'. |
|
31 ## |
2311
|
32 ## If two output arguments are specified, the data are generated but |
|
33 ## not plotted. For example, |
3426
|
34 ## |
3368
|
35 ## @example |
|
36 ## bar (x, y); |
|
37 ## @end example |
3426
|
38 ## |
3368
|
39 ## @noindent |
2311
|
40 ## and |
3426
|
41 ## |
3368
|
42 ## @example |
|
43 ## [xb, yb] = bar (x, y); |
|
44 ## plot (xb, yb); |
|
45 ## @end example |
3426
|
46 ## |
3368
|
47 ## @noindent |
2311
|
48 ## are equivalent. |
6895
|
49 ## @seealso{hbar, plot} |
3368
|
50 ## @end deftypefn |
4
|
51 |
2314
|
52 ## Author: jwe |
|
53 |
6540
|
54 function varargout = bar (varargin) |
|
55 varargout = cell (nargout, 1); |
|
56 [varargout{:}] = __bar__ (true, "bar", varargin{:}); |
4
|
57 endfunction |