Content Prev Next Down

Drawing Line and Scatter Plots
Syntax splot(y)
splot(xy)
splot(xylineStyle)
splot(xylineStylelineTypelineWidthlineColorsymbolName)
splot(xyz)
See Also spopen , spquit , spitem , spsection , sbar

Description
Plots a curve for each column of y, where y is an integer, real, or double-precision matrix specifying the y value for each point. If x is not present, i is the x value corresponding to y(i,j). If z is not present, 0 is the z value corresponding to y(i,j).

If x is present, it is an integer, real, or double-precision matrix and has the same number of rows as y. If x is a column vector, x(i) is the x value corresponding to y(i,j). Otherwise, x also has the same number of columns as y and x(i,j) is the x value corresponding to y(i,j).

If present, the argument lineStyle must be a character row vector with the value "line", "scatter", or "line & scatter" 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".

If z is present, it is an integer, real, or double-precision matrix and has the same number of rows as y. If z is a column vector, z(i) is the z value corresponding to y(i,j). Otherwise, z also has the same number of columns as y and z(i,j) is the z value corresponding to y(i,j).

Examples

Examples Plotting Y Vectors
If at the O-Matrix prompt you enter
     x = 0. : .1 : 2*pi
     splot( sin(x) ) 
SigmaPlot will create the following graph of the single Y vector, sin(x)


If you continue the example above by entering
     y = [sin(x), cos(x), 2*sin(x), 2*cos(x)]
     splot(y)
SigmaPlot will create a new plot of the 4 specified Y vectors.


Examples Using X, and Y vectors
The splot command can also be used to plot Y vectors against specified X vectors. If you continue the example above by entering
     y = [ sin(x), cos(x) ]
     splot(x, y)
SigmaPlot will create the following plot


Examples Specifying other Plot Attributes
If you continue the example above by entering
     splot(x, y, "line & scatter")
SigmaPlot will create a plot using lines and scatter symbols.

Various plot attributes may also be specified in the splot call. (Note that these attributes and many additional ones may also be controlled with the SigmaPlot graphical user interface.) If you continue the example by entering
     splot(x, y, "line", "Dash-dot", 0.1, "red")
SigmaPlot will create the following line plot


Attributes of scatter plots can also be controlled within the splot call. If you continue the example by entering
     splot(x, y, "scatter", "Dash-dot", 0.03, "red", "diamond")
SigmaPlot will create the following graph

Creating 3-Dimensional Line Plots
If SigmaPlot is not running and you enter the following at the O-Matrix prompt
     y = 0. : .01 : 2*pi
     x = sin(4*y)
     z = cos(4*y)
     splot(x, y, z)
SigmaPlot will generate the following plot