|
CPlotView:StepLine
The Stepline method creates a stepped line
plot by connecting data points with a stepped line. This is a
CPlotView class version of the non-class
stepline function. The x and y points at the same
array index are presumed to correspond to the same point. This
function also can plot x and y error bars. The data for x, y, x
error bars, and y error bars are each held in a 1-dimensional
array. The
PlotStepline method takes its data from the
CPlotView class data matrix rather than from x
and y tables. Also see the
Connect,
Line, and
Scatter commands in the CPlotView class.
This function creates a new plot window and returns
a
CPlot object for the plot series it creates.
These objects can be used to enhance or add to the plot or extract
plot data for further analysis.
Syntax
CPlot = CPlotView:StepLine( x, y )
CPlot = CPlotView:StepLine( x, y, xe )
CPlot = CPlotView:StepLine( x, y, xe, ye )
CPlot = CPlotView:StepLine( x, y, xe, ye, sLabelX
)
CPlot = CPlotView:StepLine( x, y, xe, ye,
sLabelX, sLabelY )
CPlot = CPlotView:StepLine( x, y, xe, ye,
sLabelX, sLabelY, sCaption )
CPlot = CPlotView:StepLine( x, y, xe, ye,
sLabelX, sLabelY, sCaption, sWindowTitle )
x is a 1-dimensional
array containing the x values.
y is a 1-dimensional
array containing the y values.
xe is an optional
1-dimensional array containing the x error bar values.
ye is an optional
1-dimensional array containing the y error bar values.
sLabelX is an optional
label for the x axis.
sLabelY is an optional label for the
y axis.
sCaption is an optional
plot caption.
sWindowTitle is an
optional plot window title.
Parameters
that are nil or missing to the right
adopt default values.
Return values:
CPlot is returned as a new
CPlot object attached to the current plot
series. It is nil on failure.
Remarks
The returned parameters permit access to the
plotted data. You can also change the plot properties including the
marker attributes, labels, scaling, and others using commands such
as
Series Attributes and
Plot Attributes.
Only the first 2 arguments, the (x,y) data, are
required. If you want to use the other arguments, you must include
a nil placeholder to fill any holes
between the arguments. For example, to include y error bars but not
x error bars, use nil in place of the
xe parameter.
Examples
The script below creates some data from the random
number generator and creates a stepped line plot with default plot
labels. Since none of the optional parameters is used, only the x
and y arrays need to be specified.
|
V = new_plotview()
|
|
|
x = random( 10, 10, 20 )
|
|
|
y = random( 10, 20, 40 )
|
|
|
V:StepLine( x, y )
|
|
The second example, below, repeats the above plot
but adds axis labels and error bars on the y axis.
|
V = new_plotview()
|
|
|
x = random( 10, 10, 20 )
|
|
|
y = random( 10, 20, 40 )
|
|
|
ye = random( 10, 1, 3 )
|
|
|
V:StepLine( x, y, nil, ye,
"My X", "My Y" )
|
|
Related Topics
CPlotView class
non-class stepline function
Plotting Functions
Comparison of non-Class Plotting Functions
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|