CPlotView:PlotMatrixLine
The PlotMatrixLine method makes a connected line plot from all of the rows of a CMatrix. Each row is plotted as a separate plot series.
CPlot = CPlotView:PlotMatrixLine( CMatrix )
CPlot = CPlotView:PlotMatrixLine( CMatrix, sX )
CPlot = CPlotView:PlotMatrixLine( CMatrix, sX, sY )
CPlot = CPlotView:PlotMatrixLine( CMatrix, sX, sY, sTitle )
CPlot = CPlotView:PlotMatrixLine( CMatrix, sX, sY, sTitle, sCaption )
CMatrix is a matrix holding the data to plot. All lines (rows) are plotted.
sX is the optional x axis label. If nil, a default is used.
sY is the optional y axis label. If nil, a default is used.
sTitle is the optional window title. If nil, a default is used.
sCaption is the optional plot caption. If nil, a default is used.
Return value:
CPlot is a new CPlot object attached to the current plot series.
The picture below shows a line plot using default labels for x axis, y axis, title, and caption. For this plot, the CMatrix contains one line, which is row 11 as indicated in the plot caption. The caption also indicates that columns 22 through 42 were plotted from row 11.
This method plots all of the rows of a sparse matrix using the CMatrix class. The sparse matrix is filled with members that consist of a row and column index and a value. To plot a range of rows, or only a single row, use the PlotMatrixRangeLine method. The fact that the CMatrix is sparse means that every cell does not have to be populated. In other words, indices do not need to exist between 1 and the minimum column or between 1 and the minimum row. Similarly, the matrix may have "holes" between minimum column and maximum column. For example, the picture above shows a plot made from 4 points existing in a 1-row matrix (see the data in the example, below).
The plot window above shows 4 data points having y=11 in the range x=22 to x=42. The data and plot were generated by the following script. Note: we equate "x" to column index and "y" to row index.
|
-- create a new CMatrix |
|
-- add a point at y=11, x=24, value= 10 |
|
-- add a point at y=11, x=22 |
|
-- add a point at y=11, x=42 |
|
-- add a point at y=11, x=25 |
|
-- create a new CPlotView |
|
-- create the line plot |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.