CPlot:FindNearestY
The FindNearestY method returns the index in a plot series of the point with y value nearest a target value.
nIndex, y = CPlot:FindNearestY() |
nIndex is the index of the plot series, from 1 to CPlot:Count.
y is the y value of the point.
On failure, 0,0 is returned.
The following script finds the index of the point with y value nearest 133.6 in series 1 of a CPlotView on the Mira desktop:
|
-- select the target plot window |
|
-- if not successful, exit the script |
|
-- get a CPlot object for series 1 |
|
|
|
-- find the point nearest y=133.6 |
|
-- get index n and value y |
|
-- print the results |
CPlotView class, CPlot class, FindNearestX
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.