Graphics 
Types of Bar Graphs
MATLAB has four specialized functions that display bar graphs. These functions display 2 and 3D bar graphs, and vertical and horizontal bar graphs.
TwoDimensional 
ThreeDimensional 

Grouped Bar Graph
By default, a bar graph represents each element in a matrix as one bar. Bars in a 2D bar graph, created by the bar
function, are distributed along the xaxis with each element in a column drawn at a different location. All elements in a row are clustered around the same location on the xaxis.
For example, define Y
as a simple matrix and issue the bar
statement in its simplest form.
The bars are clustered together by rows and evenly distributed along the xaxis.
Detached 3D Bars
The bar3
function, in its simplest form, draws each element as a separate 3D block, with the elements of each column distributed along the yaxis. Bars that represent elements in the first column of the matrix are centered at 1
along the xaxis. Bars that represent elements in the last column of the matrix are centered at size(Y,2)
along the xaxis. For example,
displays five groups of three bars along the yaxis. Notice that larger bars obscure Y(1,2)
and Y(1,3)
.
By default, bar3
draws detached bars. The statement bar3(Y,'detach')
has the same effect.
Labeling the Graph. To add axes labels and x tick marks to this bar graph, use the statements
Grouped 3D Bars
Cluster the bars from each row beside each other by specifying the argument 'group'.
For example,
groups the bars according to row and distributes the clusters evenly along the yaxis.
Bar and Area Graphs  Stacked Bar Graphs to Show Contributing Amounts 