bar
Bar graph.
📝 Syntax
bar(Y)
bar(X, Y)
bar(..., width)
bar(..., color)
bar(..., propertyName, propertyValue)
bar(ax, ...)
b = bar(...)
📥 Input argument
X - x-coordinates: scalar, vector or string array.
Y - y-coordinates: vector.
width - scalar, 0.8 (default).
color - a scalar string or row vector character: color name or short color name.
propertyName - a scalar string or row vector character.
propertyValue - a value.
ax - Axes object.
📤 Output argument
b - patch graphics object.
📄 Description
bar(X, Y) creates a bar graph using two sets of X-Y data vectors.
When only one argument is provided (Y), it is interpreted as a vector containing Y values, and the X coordinates are generated as a sequence from 1 to the number of elements in the Y vector.
You can optionally specify the width of the bars.
A value of 1.0 will make each bar exactly touch its neighboring bars, while the default width is set to 0.8.
💡 Examples
🔗 See also
🕔 History
1.0.0
initial version
1.12.0
Color name or short color name managed.
Last updated
Was this helpful?