23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ar, barh<br />

distinct elements and showing the relative contribution each row element<br />

makes to the total sum.<br />

bar(...,LineSpec) displays all bars using the color specified by LineSpec.<br />

h = bar(...) returns a vector of handles to patch graphics objects. bar creates<br />

one patch graphics object per column in Y.<br />

barh(...), and h = barh(...) create horizontal bars. Y determines the bar<br />

length. The vector x is a monotonic vector defining the y-axis intervals for<br />

horizontal bars.<br />

Examples Plot a bell shaped curve:<br />

1<br />

0.9<br />

0.8<br />

0.7<br />

0.6<br />

0.5<br />

0.4<br />

0.3<br />

0.2<br />

0.1<br />

x = –2.9:0.2:2.9;<br />

bar(x,exp(–x.*x))<br />

colormap hsv<br />

0<br />

−3 −2 −1 0 1 2 3<br />

Create four subplots showing the effects of various bar arguments:<br />

Y = round(rand(5,3)*10);<br />

subplot(2,2,1)<br />

bar(Y,'group')<br />

title 'Group'<br />

2-127

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

Saved successfully!

Ooh no, something went wrong!