CPlot Class Description
The CPlot class provides access to the points in a plot series for a CPlotView window. For example, if a column plot contains a column from each of 4 images, and this plot window is attached to a CPlotView object, then the CPlot class can be used to access the points in each of the 4 plot series. A CPlot class object may be created as "new" but is usually returned by a CPlotView function or by one of the non-class ploting functions.
See the sample script CPlot class test.lua in the <Documents>/Mira Pro x64 Data/Scripts/Samples folder.
The Execute Script menu command may be used to open and execute a script directly from a Mira Plot Window, prociding access to its plot series. When a script is executed from the Execute Script command, it is automatically sent a CPlotView object named ParentPlotView and a CPlot object named ParentPlot. The ParentPlotView is a CPlotView object that provides access to the window's plot series and other class members. The ParentPlot is a CPlot object attached to the current image in the Plot Window. You can use these names directly in the script or you can rename them, like V = ParentPlotView and P = ParentPlot. A sample script call to be called from a Plot Window is provided named Execute from Plot Window test.lua.
Creation |
Object = new_plot() Object = CPlot:new() Object = CPlotView:GetPlot() Object = CPlotView:GetPlot( nIndex ) |
This function is normally used to create and attach a new CPlot object as an alternative to the class-based new method. A new CPlot object is also returned by the GetPlot method of the CPlotView class.
Creates a new instance of the CPlot class. |
Creates a new instance of a CPlot object. |
|
Deletes the CPlot object. |
The data for each plotted point accessed through CPlot object is contained in a named-keyed table, named the PlotPoint table. These are accessible using the ToTable method and GetPt method.
These methods work with an plot data that holds points for plotting. The array holds the x,y coordinates and optional errorbars.
Returns the number of points in the plot series. |
|
Returns the index in a plot series of the point with x value nearest a target value. |
|
Returns the index in a plot series of the point with y value nearest a target value. |
|
Returns the PlotPoint table for the point at an index in the plot series. |
|
Returns the x value of the point at an index in a plot series. |
|
Returns the y value of the point at an index in a plot series. |
|
Returns the x and y values of the point at an index in a plot series. |
|
Creates a table containing the PlotPoint data for each point in the plot series. |
Script Classes, CPlotView class, Plotting Functions, CPlotView:GetPlot()
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics,
Inc. All Rights Reserved.