CPlot:GetPt


The GetPt method returns a PlotPoint type table containing the properties of a plot point. The related ToTable method returns an indexed table of PlotPoint tables.

Syntax

lua_table = CPlot:GetPt(nIndex)

bullet.gif    where lua_table 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, ToTable, PlotPoint table


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