LinePlot.ShowPoints

Prototypes

void ShowPoints( String sVarName <, boolean bShow> )

void ShowPoints( int nLineNum <, boolean bShow> )

void ShowPoints( Matrix mLineSpec <, boolean bShow> )

Parameters

String sVarName
The name of the Y axis variable whose points you want to affect.

int nLineNum
The number (1-based) of the line whose points you want to affect.

Matrix mLineSpec
If mLineSpec is a numeric matrix, the first element specifies the number (1-based) of the line whose points you want to affect. If mLineSpec is a character matrix, the first element specifies the name of the Y axis variable whose points you want to affect.

boolean bShow
If bShow is true, the points are displayed. If bShow is false, the points are not displayed. Calling this method without specifying the bShow parameter is equivalent to calling it with bShow equal to true.

Remarks

This method controls whether the points for a line are displayed.

The versions of this method that accept a Y axis variable name can only be used with line plots that do not use group variables.

Example
x = do(-4, 4, 0.1)`;
y = 3 + 2*x + normal(x); /* simulate data with normal errors */
x = repeat(1, nrow(x), 1) || x; /* linear design matrix */
xpx = x`*x; xpy = x`*y; /* cross-products */
yhat = x*inv(xpx)*xpy; /* predicted values */
declare DataObject dobj = DataObject.Create( "Linear Regression" );
dobj.AddVar( "X", "X", x[,2] );
dobj.AddVar( "Y", "Y", y );
dobj.AddVar( "YHat", "Predicted", yhat );
declare LinePlot plot = LinePlot.Create( dobj, "X", {"Y", "YHat"}, false );
plot.ConnectPoints( "Y", false );
plot.ShowPoints( "YHat", false );
plot.ShowWindow();