LinePlot.ConnectPoints

Prototypes

void ConnectPoints( String sVarName <, boolean bConnect> )

void ConnectPoints( int nLineNum <, boolean bConnect> )

void ConnectPoints( Matrix mLineSpec <, boolean bConnect> )

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 bConnect
If bConnect is true, the points are connected by line segments. If bConnect is false, the points are not connected. Calling this method without specifying the bConnect parameter is equivalent to calling it with bConnect equal to true.

Remarks

This method controls whether the points for a line are connected by line segments.

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();