Plot.DrawRemoveCommands

Prototypes

void DrawRemoveCommands( <String sBlockName> )

Parameters

String sBlockName
The name of the block of drawing commands to remove.

Remarks

This method removes previously issued drawing commands. If the sBlockName parameter is specified, only the drawing commands for that block are removed. If the sBlockName parameter is not specified, all drawing commands are removed.

This method affects all three drawing regions, not simply the current region.

A side effect of calling this method without specifying the sBlockName parameter is that the drawing subsystem is reset to its default state.

Example
x = T(50:100);
y = x + 10*normal(j(51,1,1234));
/* add outliers */
x = x // {2, 3, 4, 5};
y = y // {100, 95, 89, 93};
 
declare ScatterPlot plot;
plot = ScatterPlot.Create( "Outliers", x, y );
 
/* robust and non-robust regression estimates */
fitX = {0, 100};
robustFit = 6.6333 + 0.9349 * fitX;
leastSqFit = 59.41889 + 0.24689 * fitX;
 
plot.DrawUseDataCoordinates();
plot.DrawSetPenColor( RED );
plot.DrawLine( fitX[1], robustFit[1], fitX[2], robustFit[2] );
 
plot.DrawBeginBlock( "Least Square Regression" );
plot.DrawSetPenColor( BLACK );
plot.DrawLine( fitX[1], leastSqFit[1], fitX[2], leastSqFit[2] );
plot.DrawText( 20, 70, "LS Fit" );
plot.DrawEndBlock();
 
plot.DrawSetTextColor( RED );
plot.DrawText( 20, 40, "Robust Fit" );
 
run DoMessageBoxOK( "Continue",
    "Press OK to remove the least squares fit" ); 
 
plot.DrawRemoveCommands( "Least Square Regression" );
See Also

Plot.DrawBeginBlock
Plot.DrawEndBlock
Plot.DrawResetState