CPlotView Class Description
The CPlotView class displays 1-dimensional data as a plot. The CPlotView class leverages the richness and power of the Mira Plot Window and also can operate on existing Plot windows you attach to the script. Point data can be plotted from the following sources:
An internal collection (matrix) of data points filled using the Add method. This protocol is the most general, providing any combination of moves, markers, and lines, with or without error bars.
Equally spaced data stored in the rows of a CMatrix. These data can be plotted as a line plot or using symbols. The step values on the x axis are unit values, so this protocol is useful for plotting line graphs of image data.
The rows and columns of a CImage.
The rows and columns of a displayed image as outlined by the image cursor in a CImageView.
The Execute Script menu command may be used to open and execute a script directly from a Mira Plot Window. When a script is executed from this 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.
The following functions are provided to expedite plotting of data when the values to be plotted are in arrays (indexed tables). The functions also can plot x error bars and y error bars. The non-class plotting functions are compared here. Also see the Connect, Line, Scatter, and StepLine commands in the CPlotView class.
Creates a plot with markers in which line segments connect the markers. |
|
Creates a plot with markers and error bars in which line segments connect the markers. |
|
Computes the histogram of a 1-dimensional array and plots it as a stepped line. |
|
Creates a line plot that connects all points. |
|
Creates a line plot and error bars that connects all points. |
|
Creates a scatter plot using markers. |
|
Creates a scatter plot and error bars using markers. |
|
Creates a plot plot with a stepped line between points. |
|
Creates a plot plot and error bars with a stepped line between points. |
Construction |
Object = attach_plotview() Object = new_plotview() Object = CPlotView:new() |
Destruction |
Object:delete() |
These functions are normally used to create and attach a new CPlotView object as an alternative to the class-based construction methods.
Creates a new instance of the CPlotView class. |
|
Creates a new CPlotView object attached to the top-most plot window on the Mira desktop. This is equivalent to the Attach class method. |
|
Creates a new CPlotView object attached to a plot window selected from a list of plot windows on the Mira desktop. This is equivalent to the AttachFromList class method. |
|
Returns the title of the Mira Plot Window. |
Creates a new instance of a CPlotView object. |
|
Deletes the CPlotView object. |
|
Attaches the top-most window (a Plot window) to the script and creates a new CPlotView object for it. |
|
Attaches a plot window selected from a list of plot windows on the Mira desktop and returns a new CPlotView object for it. |
|
Closes the CPlotView window. |
These methods work with an plot data that holds points for plotting. This array holds the x,y coordinates and optional errorbars.
Adds an x,y pair and optional error bars to the plot data. |
|
Returns the number of points in the plot data. |
|
Empties all point data from the plot data. |
|
Returns the index of the point in the plot data nearest an x,y. |
|
Returns a CPlot object for working with the points in a plot series. |
|
Returns the x value of a point. |
|
Returns the y value of a point. |
|
Returns the x errorbar value of a point. |
|
Returns the y errorbar value of a point. |
|
Deletes a point from the plot data. |
These methods plot the class data matrix into a new window, append an existing plot, or plot it as a new series in an existing window.
Create a connected plot with markers and line segments from two tables for the x and y values. |
|
Create a line plot with line segments between points from two tables for the x and y values. |
|
Create a scatter plot with markers from two tables for the x and y values. |
|
Create a stepped-line plot from two tables for the x and y values. |
|
Creates a connected plot with markers and connecting lines for points in the plot data. |
|
Creates a line plot from points in the plot data. Markers are not drawn. |
|
Creates a scatter plot of markers from in the plot data. |
|
Creates a stepped line plot from points in the plot data. |
|
|
|
Creates a plot from points in the plot data. |
|
Adds the current series in an existing plot window into the class data matrix. |
|
Adds the class data matrix to an existing plot window as a new plot series. |
These commands create plot data from the columns or rows of images and displayed images.
Plots a column from a CImage. |
|
Plots a row from a CImage. |
|
Plots the column at the center of the image cursor for images displayed in a CImageView. |
|
Plots the averaged column inside the image cursor for images displayed in a CImageView. |
|
Plots all columns inside the image cursor for images displayed in a CImageView. |
|
Plots the row at the center of the image cursor for images displayed in a CImageView. |
|
Plots the averaged row inside the image cursor for images displayed in a CImageView. |
|
Plots all rows inside the image cursor for images displayed in a CImageView. |
These methods work with the plot series of the plot window.
Returns the number of plot series. |
|
Returns the number of plotted points in a plot series. |
|
Returns the index of the current plot series. |
|
Returns a CPlot object for a plot series in the CPlotView object. |
|
Sets the index of the current plot series. |
|
Sets a description for a plot series. |
|
Rereieves the description from a plot series. |
These methods work with an external CMatrix as the data source for plotting. Each row of the matrix defines a different plot series. Within a row, each (column,value) pair defines an (x,y) value to be plotted. The "x" value is the integral column corresponding to To plot general points, us the non ,atrix methods, like Add, PlotPoints, and AddSeries.
NOTE: Matrix plotting is an old plotting protocol that is discouraged going forward. Support for the matrix plotting protcol and methods listed below will end in 2024.
Appends a range or matrix rows to an existing plot as symbols. |
|
Appends a range of matrix rows to an existing plot as lines. |
|
Creates a scatter plot of all rows in a matrix. |
|
Creates a line plot of all rows in a matrix. |
|
Creates a multi-series scatter plot from a range of rows in a matrix. |
|
Creates a multi-series line plot from a range of rows in a matrix. |
Comparison of non-Class Plotting Functions
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.