1## Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2004,
2## 2005, 2006, 2007, 2008, 2009 John W. Eaton
4## This file is part of Octave.
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
8## the Free Software Foundation; either version 3 of the License, or (at
9## your option) any later version.
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.
16## You should have received a copy of the GNU General Public License
17## along with Octave; see the file COPYING. If not, see
18## <http://www.gnu.org/licenses/>.
21## @deftypefn {Function File} {} bar (@var{x}, @var{y})
22## @deftypefnx {Function File} {} bar (@var{y})
23## @deftypefnx {Function File} {} bar (@var{x}, @var{y}, @var{w})
24## @deftypefnx {Function File} {} bar (@var{x}, @var{y}, @var{w}, @var{style})
25## @deftypefnx {Function File} {@var{h} =} bar (@dots{}, @var{prop}, @var{val})
26## @deftypefnx {Function File} {} bar (@var{h}, @dots{})
27## Produce a bar graph from two vectors of x-y data.
29## If only one argument is given, it is taken as a vector of y-values
30## and the x coordinates are taken to be the indices of the elements.
32## The default width of 0.8 for the bars can be changed using @var{w}.
34## If @var{y} is a matrix, then each column of @var{y} is taken to be a
35## separate bar graph plotted on the same graph. By default the columns
36## are plotted side-by-side. This behavior can be changed by the @var{style}
37## argument, which can take the values @code{"grouped"} (the default),
38## or @code{"stacked"}.
40## The optional return value @var{h} provides a handle to the "bar series"
41## object with one handle per column of the variable @var{y}. This
42## series allows common elements of the group of bar series objects to
43## be changed in a single bar series and the same properties are changed
44## in the other "bar series". For example
48## h = bar (rand (5, 10));
49## set (h(1), "basevalue", 0.5);
54## changes the position on the base of all of the bar series.
56## The optional input handle @var{h} allows an axis handle to be passed.
57## Properties of the patch graphics object can be changed using
58## @var{prop}, @var{val} pairs.
60## @seealso{barh, plot}
65function varargout = bar (varargin)
66 varargout = cell (nargout, 1);
67 [varargout{:}] = __bar__ (true, "bar", varargin{:});