12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ar3, bar3h• 'grouped' displays n groups of m vertical bars, where n is the number ofrows and m is the number of columns in Y. The group contains one bar percolumn in Y.• 'stacked' displays one bar for each row in Y. The bar height is the sum ofthe elements in the row. Each bar is multi-colored, with colors correspondingto distinct elements and showing the relative contribution each row elementmakes to the total sum.bar3(...,LineSpec) displays all bars using the color specified by LineSpec.h = bar3(...) returns a vector of handles to patch graphics objects. bar3creates one patch object per column in Y.bar3h(...) and h = bar3h(...) create horizontal bars. Y determines the barlength. The vector x is a monotonic vector defining the y-axis intervals forhorizontal bars.ExamplesThis example creates six subplots showing the effects of different argumentsfor bar3. The data Y is a seven-by-three matrix generated using the coolcolormap:Y = cool(7);subplot(3,2,1)bar3(Y,’detached’)title(‘Detached’)subplot(3,2,2)bar3(Y,0.25,’detached’)title(‘Width = 0.25’)subplot(3,2,3)bar3(Y,’grouped’)title(‘Grouped’)2-46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!