CPlotView:PlotMatrixRange
The PlotMatrixRange method plots data stored in one or more rows of a CMatrix. This method uses an external matrix, not the class data matrix. The data are plotted as symbols. Each row creates a different plot series.
bSuccess = CPlotView:PlotMatrixRange( CMatrix, y1, y2, sX=nil, sY=nil, sTitle=nil, sCaption=nil )
|
Line Plot window using default x label, y label, title, and caption. The caption above the plot box shows that data in columns 22 42 and rows 12 through 14 were plotted. The 3 rows were plotted in 3 series using different colors (black, red, green). There were no points in row 14. |
This method make a symbol plot from a range of rows in a CMatrix. Alternatively, you can make the same type of plot, but with connected lines rather than symbols, using the PlotMatrixRangeLine method. In comparison, the PlotMatrixLine and PlotMatrix methods plot all rows of the matrix, rather than a range of rows.
The plotted data come from a sparse CMatrix. The matrix contains values at (column,row) indices. The matrix rows are not required to have the same beginning and ending columns. Every row does not have to exist in the plotted range, nor does every column need a value. Holes are automatically set to 0. For example, the picture above shows a plot made from 4 points existing in the first row of a small matrix (see the example, below).
The plot window above shows 3 data points plotted with only 1 point in each of the 3 series. These points were plotted from rows 12, 13, and 14 in a matrix containing 8 points in the rectangle [22:42, 11:16] (note: this is [column:column, row:row notation]). Points in rows 11, 15, and 16 were ignored and no point exists in row 14, which lies in range. The x-axis scaling extends from column 22 through 38 because that is the region covered by the matrix. The data and plot were generated by the following script:
|
-- create a new CMatrix |
|
-- add a point at y=16, x=22, value= 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- create a new CPlotView |
|
-- create the line plot |