Horizontal Bar Charts
Syntax sbarh(X)
sbarh(X, y)
sbarh(X, y, barStyle)
sbarh(X, y, errors)
See Also sbar , splot , spquit
Description
Create a horizontal bar graph. The argument X must be a numeric column vector or matrix. If X is a vector SigmaPlot creates a simple bar graph with N bars where N is the number of rows in X. If X is a matrix, SigmaPlot creates a grouped or stacked bar graph with M groups, and N bars per group where M is the column dimension of X and N is the row dimension of X.
The argument y is a numeric column vector which specifies the Y axis indexes at which each bar, or bar group will be placed. The argument barStyle is a character row vector which must be "stacked" or "grouped". If the barStyle argument is specified the column dimension of Y must be greater than 1. If present, the argument errors is a numeric-valued matrix with the same row and column dimensions as Y. Each column of errors specifies the error values that should be plotted for the corresponding column of X
Examples
Bar Charts Without Errors
If SigmaPlot is not running, and you enter the following at the O-Matrix prompt,
clear
X = {2., 2.5, 3.25}
y = {11.25, 11.50, 11.75}
X4 = [X, X*1.5, X*1.75, X*1.95]
sbarh(X4)
sbarh(X4, y, "stacked")
SigmaPlot will create the following plots
Bar Charts With Errors
If you continue the example above by entering
sbarh(X, y, {.2, .3, .1})
sbarh(X4, y, rand(rowdim(X4), coldim(X4))*2)
SigmaPlot will create a stacked and grouped horizontal bar chart with error bars and your notebook will look like.
Syntax sbarh(X)
sbarh(X, y)
sbarh(X, y, barStyle)
sbarh(X, y, errors)
See Also sbar , splot , spquit
Description
Create a horizontal bar graph. The argument X must be a numeric column vector or matrix. If X is a vector SigmaPlot creates a simple bar graph with N bars where N is the number of rows in X. If X is a matrix, SigmaPlot creates a grouped or stacked bar graph with M groups, and N bars per group where M is the column dimension of X and N is the row dimension of X.
The argument y is a numeric column vector which specifies the Y axis indexes at which each bar, or bar group will be placed. The argument barStyle is a character row vector which must be "stacked" or "grouped". If the barStyle argument is specified the column dimension of Y must be greater than 1. If present, the argument errors is a numeric-valued matrix with the same row and column dimensions as Y. Each column of errors specifies the error values that should be plotted for the corresponding column of X
Examples
Bar Charts Without Errors
If SigmaPlot is not running, and you enter the following at the O-Matrix prompt,
clear
X = {2., 2.5, 3.25}
y = {11.25, 11.50, 11.75}
X4 = [X, X*1.5, X*1.75, X*1.95]
sbarh(X4)
sbarh(X4, y, "stacked")
SigmaPlot will create the following plots
Bar Charts With Errors
If you continue the example above by entering
sbarh(X, y, {.2, .3, .1})
sbarh(X4, y, rand(rowdim(X4), coldim(X4))*2)
SigmaPlot will create a stacked and grouped horizontal bar chart with error bars and your notebook will look like.