|
CPlot:GetX
The GetX method returns the x value of the
point at an index in a plot series.
Syntax
|
x, success = CPlot:GetX( nIndex )
|
nIndex is the index of the plot series, from 1 to
CPlot:
Count.
x is the x value of the point.
success is a boolean value and is
true if the index is valid. This second argument may
be omitted if the index is known to be valid.
On failure
0,
false is returned.
Example
The following script gets the x value of the 15th
point in plot series 1 of a CPlotView on the Mira
desktop:
|
V = attachlist_plotview()
|
|
|
if V == nil then Exit() end
|
|
|
P = V:GetPlot(1)
|
|
|
if P == nil then Exit("Bad series")
end
|
|
|
nIndex = 15
|
|
|
x, success = P:GetX( nIndex
)
|
|
|
if success then
|
|
|
Printf("x[%d]=%lg\n",
nIndex, x)
|
|
|
else
|
|
|
Printf("Index %d is out
of range\n", nIndex)
|
|
|
end
|
|
Related Topics
CPlotView class
CPlot class
GetY
GetXY
GetPt
Mira Pro x64 Script User's Guide, v.8.76 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.
|