7017
|
1 ## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2004, |
|
2 ## 2005, 2006, 2007 John W. Eaton |
2313
|
3 ## |
|
4 ## This file is part of Octave. |
|
5 ## |
|
6 ## Octave is free software; you can redistribute it and/or modify it |
|
7 ## under the terms of the GNU General Public License as published by |
7016
|
8 ## the Free Software Foundation; either version 3 of the License, or (at |
|
9 ## your option) any later version. |
2313
|
10 ## |
|
11 ## Octave is distributed in the hope that it will be useful, but |
|
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14 ## General Public License for more details. |
|
15 ## |
|
16 ## You should have received a copy of the GNU General Public License |
7016
|
17 ## along with Octave; see the file COPYING. If not, see |
|
18 ## <http://www.gnu.org/licenses/>. |
245
|
19 |
3368
|
20 ## -*- texinfo -*- |
7086
|
21 ## @deftypefn {Function File} {@var{h} =} bar (@var{x}, @var{y}, @var{p1}, @var{v1}, @dots{}) |
6540
|
22 ## @deftypefnx {Function File} {[@var{xb}, @var{yb}] =} bar (@dots{}) |
6895
|
23 ## Given two vectors of x-y data, @code{bar} produce a bar graph. |
3426
|
24 ## |
2311
|
25 ## If only one argument is given, it is taken as a vector of y-values |
|
26 ## and the x coordinates are taken to be the indices of the elements. |
3426
|
27 ## |
6540
|
28 ## If @var{y} is a matrix, then each column of @var{y} is taken to be a |
|
29 ## separate bar graph plotted on the same graph. By default the columns |
|
30 ## are plotted side-by-side. This behavior can be changed by the @var{style} |
7086
|
31 ## argument, which can take the values @code{"grouped"} (the default), |
|
32 ## or @code{"stacked"}. |
6540
|
33 ## |
2311
|
34 ## If two output arguments are specified, the data are generated but |
|
35 ## not plotted. For example, |
3426
|
36 ## |
3368
|
37 ## @example |
|
38 ## bar (x, y); |
|
39 ## @end example |
3426
|
40 ## |
3368
|
41 ## @noindent |
2311
|
42 ## and |
3426
|
43 ## |
3368
|
44 ## @example |
|
45 ## [xb, yb] = bar (x, y); |
|
46 ## plot (xb, yb); |
|
47 ## @end example |
3426
|
48 ## |
3368
|
49 ## @noindent |
2311
|
50 ## are equivalent. |
6895
|
51 ## @seealso{hbar, plot} |
3368
|
52 ## @end deftypefn |
4
|
53 |
2314
|
54 ## Author: jwe |
|
55 |
6540
|
56 function varargout = bar (varargin) |
|
57 varargout = cell (nargout, 1); |
|
58 [varargout{:}] = __bar__ (true, "bar", varargin{:}); |
4
|
59 endfunction |