CPlot:FindNearestY CPlot:SetPt

CPlot:GetPt


The GetPt method returns a PlotPoint table containing the properties of a plot point. The related ToTable method returns an indexed table of PlotPoint tables (one sub-table for each plot point).

Syntax

PlotPoint = CPlot:GetPt(nIndex)

bullet.gif    where nIndex is the index of the point in the CPlot object.

bullet.gif    PlotPoint is a PlotPoint table.

bullet.gif    On failure, nil is returned.

Example

The following script attaches a CPlotView from the Mira desktop and prints the properties of the point at index 15 in plot series 1:

V = attachlist_plotview()

-- select the target plot window

if V == nil then Exit() end

-- if not successful, exit the script

P = V:GetPlot(1)

-- get a CPlot object for series 1

if P == nil then Exit("Bad series") end

 

t = P:GetPt(15)

-- Get the point data for index 15

if t == nil then Exit("point 15 is nil") end

 

-- print the properties of the point at index 15

 

Printf("(x,y), (xe,xe), stat, vis\n")

-- print a table heading

Printf("(%lg,%lg), (%lg,%lg), %d, %d\n",

 

       t.x, t.y, t.xe, t.ye, t.status, t.visible)

-- print all properties of the point

Related Topics

CPlotView class

CPlot class

SetPt

ToTable

PlotPoint table

 


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.