FUNCTION REFERENCE

bar

Bar plot.

Bar plot.

Syntax

bar(y)

Syntax

bar(x, y)

Syntax

bar(..., style)

Syntax

bar(..., width)

Syntax

b = bar(...)

Draws grouped or stacked bars ('grouped' or 'stacked'). A scalar width in (0,1], a single color letter, or Bar properties (BarLayout, BarWidth, FaceColor including 'flat' and 'none', EdgeColor, CData, FaceAlpha, LineStyle) can follow the data. Returns one Bar handle per column.

Example

b = bar([1 2; 3 4], 'stacked'); b(1).FaceColor = 'flat'; b(1).CData(2,:) = [1 0 0];   % stacked bars with per-bar CData

Differences from MATLAB: Only a single color letter is accepted, not full line specs. Up to 16 figures and 64 series.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.