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.

ar, barhPurpose2bar, barhBar chartSyntaxbar(Y)bar(x,Y)bar(...,width)bar(...,'style')bar(...,LineSpec)[xb,yb] = bar(...)h = bar(...)barh(...)[xb,yb] = barh(...)h = barh(...)DescriptionA bar chart displays the values in a vector or matrix as horizontal or verticalbars.bar(Y) draws one bar for each element in Y. If Y is a matrix, bar groups thebars produced by the elements in each row. The x-axis scale ranges from 1 tolength(Y) when Y is a vector, and 1 to size(Y,1), which is the number of rows,when Y is a matrix.bar(x,Y) draws a bar for each element in Y at locations specified in x, where xis a monotonically increasing vector defining the x-axis intervals for thevertical bars. If Y is a matrix, bar clusters the elements in the same row in Y atlocations corresponding to an element in x.bar(...,width) sets the relative bar width and controls the separation of barswithin a group. The default width is 0.8, so if you do not specify x, the barswithin a group have a slight separation. If width is 1, the bars within a grouptouch one another.2-41

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

Saved successfully!

Ooh no, something went wrong!