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