CPlotView:GetErrY
The GetErrY method returns the y errorbar value of a point in the class data matrix.
yErr = CPlotView:GetErrY( n ) |
n is the index of the point in the data array.
yErr is the value of the y errorbar.
On success, this method returns the y errorbar value.
On failure, this method returns 0.
This method returns the y errorbar value of the specified point at index n. If n is out of range, the value 0 is returned. To remove ambiguity about whether the point truly has a y-errorbar value of 0 or is out of bounds, check the index before calling this method.
The following script fragment adds some points, then finds the nearest point and prints its y errorbar value:
P = CPlotView:new() |
-- create a new CPlotView |
P:Add( 11.82, 70.5, 10.25, 12.4) |
-- add a point |
P:Add( 4.62, 90.5, 11.5, 10.2) |
-- add a point |
n = P:FindPoint( 4, 72) |
-- get index of point nearest 4,72 |
Printf("n=%d,yerr=%lg\n",n,P:GetErrY(n)) |
-- result: n = 1, yerr = 12.4 |