해결책
JSL을 사용하여 데이터 요약을 실행합니다. 요약 값을 가져와 그래프 빌더 스크립트에 삽입합니다.
// here's an example table; the x1 and x2 have different means and sigmas
dt = New Table( "Untitled",
Add Rows( 1e4 ),
New Column( "x1", Numeric, "Continuous", Format( "Best", 12 ), Formula( Random Normal( 400, 90 ) ) ),
New Column( "x2", Numeric, "Continuous", Format( "Best", 12 ), Formula( Random Normal( 600, 30 ) ) )
);
// the summary will be a single row with the requested information
dtsummary = dt << Summary(
Mean( :x1 ),
Mean( :x2 ),
Std Dev( :x1 ),
Std Dev( :x2 ),
Freq( "None" ),
Weight( "None" )
);
// grab the values of interest in simpler variable names
x1Mean = dtsummary:name("Mean(x1)")[1]; // row one has the answers
x1StdDev = dtsummary:name("Std Dev(x1)")[1];
x2Mean = dtsummary:name("Mean(x2)")[1];
x2StdDev = dtsummary:name("Std Dev(x2)")[1];
// make a graph
gb = dt<<GRAPH builder="">get script.
// below, the numbers in the script have been replaced with the variables above.
SendToReport( Dispatch( {}, "x1", ScaleBox,
{Add Ref Line( x1Mean, "Dotted", "Red", "", 2 ),
Add Ref Line( x1Mean+x1StdDev, "Dotted", "Blue", "", 2 ),
Add Ref Line( x1Mean-x1StdDev, "Dotted", "Blue", "", 2 )
}
),
Dispatch( {}, "x2", ScaleBox,
{Add Ref Line( x2Mean, "Dotted", "Red", "", 2 ),
Add Ref Line( x2Mean+x2StdDev, "Dotted", "Blue", "", 2 ),
Add Ref Line( x2Mean-x2StdDev, "Dotted", "Blue", "", 2 )
}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Marker Size( 1 ), Transparency( 0.5 )} ) )
);
// make the data space square
report(gb)[framebox(1)]<<SIZE to="" isometric=""></SIZE></GRAPH>