barh
Twodimensional horizontal bar plot.
barh(x)
barh(x,options)
barh(x,y)
barh(x,y, options)
Inputs 
x 
An array of real numbers. 
y 
An array of real numbers. 
Outputs 
options 
A set of options to control the appearance of the plot. One of the options may be specified as the
string 'stacked' or 'grouped' for stacking or grouping
multiple bars. The other option may be used to
specify the width of the plot in the form of a pair 'width', w , where
w is the width parameter, a number between 0 and 1 .

Description
If x
is a onedimensional array, barh(x)
displays horizontal
rectangular bars at the points [1,2,..n]
along the yaxis, where n
is the number of elements
in x
. The width of the bars is proportional to the
magnitudes of the elements of x
.
If x
has m
columns, barh(x)
displays m
horizontal
rectangular bars at each of the points
[1,2,..n]
where n
is the number of rows in x
.
If one of the options
is the string 'stacked'
, the bars at
each point [1,...n]
are stacked horizontally one over the other
with the heights of the stacks determined by the
elements in a given row of x
.
Otherwise the bars at a given point are grouped side by side.
The distance between the bars at adjoining points on the yaxis
can be controlled by specifying the width parameter in the input
options
. If width is specified to be one, there is no gap between
the bars at various points, and if it is zero, bars are
displayed with maximum possible gaps between them. Intermediate values
of the width parameter control the width of gaps accordingly.
In the call barh(x, y)
, the width of the bars is specified by the
elements of y
, and elements of x
are used
for the locations of the bars along the yaxis. The inputs
specified in options
control the
gap size and the type of grouping of bars just as for the call barh(x)
.
Example
>>subplot(2,2,1)
>>barh(rand(4,1))
>>title("Horizontal Bar Plot")
>>ytics([1 2 3 4],{"One","Two","Three","Four"});
>>subplot(2,2,2)
>>barh(rand(4,3),'grouped')
>>title("Grouped Horizontal Bar Plot")
>>ytics([1 2 3 4],{"One","Two","Three","Four"});
>>subplot(2,2,3)
>>barh(rand(4,3),'stacked')
>>title("Stacked Horizontal Bar Plot")
>>ytics([1 2 3 4],{"One","Two","Three","Four"});
>>subplot(2,2,4)
>>barh(rand(4,1),'width',.3)
>>title("Horizontal Bar Plot")
>>ytics([1 2 3 4],{"One","Two","Three","Four"});