CPlotView:Class Description


The CPlotView class displays 1-dimensional data in a Mira Plot Window. This class can plot data from the following sources:

    An internal data matrix belonging to the class. The matrix holds point data and error bars for producing a scatter plot. This is a CMatrix that is automatically created when the CPlotView object is created using the new operator. Each CPlotView object has its own private data matrix.

    Equally spaced data stored in the rows of a CMatrix. These data can be plotted as a line plot or using symbols.

    The rows and columns of a CImage.

    The rows and columns of a displayed image as outlined by the image cursor in a CImageView.

Usage

Construction

Object = CPlotView:new()

Destruction

Object:delete()

Data Members

ptr

A pointer to the Mira Plot View window. This pointer is nil if no plot view window has been attached.

Note: It is not wise to work directly with ptr. Instead, refer to ptr using the GetViewPtr method.

Methods

Construction

new

Creates a new instance of a CPlotView object.

delete

Deletes the CPlotView object.

Attach

Attaches the top-most window (a Plot window) to the script and creates a new CPlotView object for it.

GetWnd

Returns the handle of the Plot Window attached to this CPlotView object.

SetWnd

Attaches the handle of a Plot Window to this CPlotView object.

Data Array

These methods manipulate an internal data array that holds points for plotting. The data array holds point data for x,y coordinates and optional errorbars.

Add

Adds a new x,y pair and optional error bars to the data array.

Count

Returns the number of points in the data array.

Empty

Empties all point data from the data array.

FindPoint

Returns the index of the point in the data array nearest an x,y.

GetX

Returns the x value of a point.

GetY

Returns the y value of a point.

GetErrX

Returns the x errorbar value of a point.

GetErrY

Returns the y errorbar value of a point.

Remove

Deletes a point from the data array.

Data Plotting

These methods plot the class data matrix into a new window, append to an existing plot, or plot it as a new series in an existing window.

AddPoints

Adds the current series of an existing plot window with the data array.

AddSeries

Adds the class data matrix to an existing plot window as a new plot series.

PlotPoints

Creates a scatter plot from the data array.

Matrix Plotting

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.

AddMatrixRange

Appends a range or matrix rows to an existing plot as symbols.

AddMatrixRangeLine

Appends a range of matrix rows to an existing plot as lines.

PlotMatrix

Creates a scatter plot of all rows in a matrix.

PlotMatrixLine

Creates a line plot of all rows in a matrix.

PlotMatrixRange

Creates a multi-series scatter plot from a range of rows in a matrix.

PlotMatrixRangeLine

Creates a multi-series line plot from a range of rows in a matrix.

Image Plotting

These commands create plot data from the columns or rows of images and displayed images.

PlotImageCol

Plots a column from a CImage.

PlotImageRow

Plots a row from a CImage.

PlotCursorCol

Plots the column at the center of the image cursor for images displayed in a CImageView.

PlotCursorColAvg

Plots the averaged column inside the image cursor for images displayed in a CImageView.

PlotCursorColRange

Plots all columns inside the image cursor for images displayed in a CImageView.

PlotCursorRow

Plots the row at the center of the image cursor for images displayed in a CImageView.

PlotCursorRowAvg

Plots the averaged row inside the image cursor for images displayed in a CImageView.

PlotCursorRowRange

Plots all rows inside the image cursor for images displayed in a CImageView.

Plot Series

These methods work with the plot series of the plot window.

CountSeries

Returns the number of plot series.

CountSeriesPoints

Returns the number of plotted points in a plot series.

GetIndex

Returns the index of the current series.

SetIndex

Sets the index of the current series.

Related Topics

CImage, CRect, CMatrix, CImageView