bar3(Y)
bar3(Z, Y)
bar3(..., width)
bar3(..., 'detached')
bar3(..., 'grouped')
bar3(..., 'stacked')
bar3(..., color)
bar3(parent, ...)
h = bar3(...)
| Parameter | Description |
|---|---|
| Y | Numeric vector or matrix of bar heights. |
| Z | row positions for the bars. |
| width | Relative bar width. The default value is 0.8. |
| color | color name or short color name for the bar faces. |
| Parameter | Description |
|---|---|
| h | surface graphics object or vector of surface graphics objects. |
bar3 displays columns as 3-D cuboids. Matrix columns are shown along the x direction and matrix rows along the y direction.
Use 'grouped' to group matrix columns at each row position and 'stacked' to stack matrix columns at each row position.
f = figure();
Y = [1 2 3; 4 5 6];
bar3(Y);
f = figure();
z = [50 40 30 20 10];
bar3(z);
f = figure();
z = [1950 1960 1970 1980 1990];
y = [16 8 4 2 1];
bar3(z, y);
f = figure();
y = [1 2; 3 4; 5 6];
bar3(y, 'grouped');
f = figure();
y = [1 -2; -3 4];
bar3(y, 'stacked');
f = figure();
h = bar3(peaks(5), 0.6);
set(h, 'FaceColor', [0.2 0.5 0.8], 'FaceAlpha', 0.8);