Content Prev Next Down

Creating Error Bar Plots
Syntax serrorbars(xyerrorVals)
serrorbars(xyerrorValslineStyle)
serrorbars(xyerrorValslineStylelineTypelineWidthlineColorsymbolName)
See Also splot , sbar , spopen , spitem

Description
Plots the graph of vector x vs. each column of matrix y with error bars specified by matrix errorVals. The variables x, y, and errorVals must all have the same row dimension. The variables y and errorVals must have the same column dimension.

If present, the argument lineStyle must be a character row vector with the value "scatter", "line & scatter", or "regression" and specifies the type of line plot to create.

If present, the argument lineType is a character row vector which specifies the type of line to use for the current plot if the current plot includes lines. Valid values are: "None", "Solid", "Long dash", "Medium dash", "Short dash", "Dotted", "Dash-dot", and "Dash-dot-dot".

If present, the argument lineWidth specifies the width of lines in the current plot in inches. The value of lineWidth must range between 0.0 and 0.25.

If present, the argument lineColor is a character row vector which specifies the color for lines in the current plot. Valid values are: "black", "blue", "cyan", "dkblue", "dkcyan", "dkgray", "dkgreen", "dkpink", "dkred", "dkyellow", "gray", "green", "pink", "red", "white", and "yellow".

If present, the argument symbolName is a character row vector which specifies the name of the symbol to use in the current plot. Valid values are: "none", "circle", "square", "upward triangle", "downward triangle", "diamond", "hexagon", "horizontal bar", and "vertical bar".

Examples

Y Vectors With Error Bars
If at the O-Matrix prompt you enter
   clear
   x = 1:1:10
   y = x^2
   errorVals = rand(rowdim(x), 1) * 10
   serrorbars(x, y, errorVals)
SigmaPlot will create the following error bars plot


If you continue the example above by entering
   serrorbars(x, y, errorVals, "regression")
SigmaPlot will create another graph of the data that includes a regression fit line through the x,y data


Multiple Y vectors with Multiple Error Vectors
The serrorbars command can also be used to plot multiple Y vectors. If you continue the example above by entering
   y = [y, y*1.2]
   errorVals = [errorVals, errorVals*1.3]
   serrorbars(x, y, errorVals)
SigmaPlot will create the following plot


Examples Specifying other Plot Attributes
Several plot attributes may be changed in the serrorbars argument list. If you continue the example above by entering
   serrorbars(x,y,errorVals,"regression","Short dash",0.02,"blue","diamond")
SigmaPlot will create the following plot