Names default to here(1);
generatePlot=Function ({nRows},{Default Local},
dt = New Table();
dt << add rows( nRows );
dt:Column1 << set name( "group" ) << Set Modeling Type( "Nominal" ) <<
Formula( tmp=Random uniform( 2 );If(tmp<0.001,0,tmp < 0.5, 1,2) );
dt << New Column( "select", Formula( Random Uniform( ) ) );
dt << New Column( "rnd", Formula( Random Normal( ) ) );
dt << New Column("Reference", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, Empty(), :rnd)));
dt << New Column("Value", Numeric, "Continuous", Format("Best", 12), Formula(If(:group == 0, :rnd)));
dt << Graph Builder(
Size( 840, 589 ),
Show Control Panel( 0 ),
Variables( X( :group ), Y( :Reference ), Y( :Value, Position( 1 ) ) ),
Elements(
Points( X, Y( 2 ), Legend( 19 ) ),
Box Plot( X, Y( 2 ), Legend( 22 ) ),
Contour( X, Y( 1 ), Legend( 23 ) )
),
SendToReport(
Dispatch( {}, "graph title", TextEditBox, {Set Text( "rnd vs. group" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "rnd" )} )
)
)
);
//All three should look the same
generatePlot(100000);
generatePlot(500000);
generatePlot(1000000);