CPlotView:PlotPoints
The PlotPoints method draws points from the class data matrix in a new plot window. This method can plot markers, lines, and errob bars for both axes. The illustration below shows only (x,y) pairs without errorbars.
bSuccess = CPlotView:PlotPoints( sX=nil, sY=nil, sTitle=nil, sCaption=nil )
Sample Plots
The first plot below shows a simple scatter plot without error bars. This plot was generated using the first sample script in the Examples, below. The legend was turned off
The plot below was generated using the second script in the Examples..
To plot the same data as connected lines rather than as discrete symbols, use the PlotDataLine method. To plot a range of rows or a single row, use the PlotDataRange method.
This method plots all points in the class data matrix as a single series in a plot window. Data points are drawn as symbols as shown above.
The script below created the plot window shown above. Although this example shows simple (x,y) points, y errorbars or x,y errorbars could have been plotted by adding them their extra arguments in the Add method.
|
-- create a new CPlotView |
|
-- add point 1: x=5.62, y=100.5 |
|
-- add other points |
|
|
|
|
|
|
|
|
|
|
|
|
-- make the plot |
|
|
The next example is far more sophisticated but only a little more complicated. This example uses all 5 arguments for the Add method, which includes the draw mode for each point (e.g., move to, line to, marker, etc.). The script adds points into 2 data series and displays them simultaneously in "over plot" mode. Error bars are included in the first series. This script generated the plot shown above.
|
|
|
-- add marker (with error bars) |
|
-- line to point |
|
-- line to point |
|
-- line to [pomt with error bars |
|
-- add marker with error bars |
|
-- line to marker |
|
-- add marker with error bar |
|
-- line to point with error bars |
|
|
-- Display the points in a new plot window |
|
|
|
|
|
-- define another group of points (not ordered by increasing x value) |
|
|
-- emove data points already defined |
|
-- add all points as "LineToMarker" |
|
|
|
|
|
|
|
|
|
|
|
-- add these 6 points as a new series |
|
|
|
-- add legend at bottom |
|
-- change to "overplot" mode. |