dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
d1=dt << Summary(
Group( :age, :sex ),
Sum( :height ),
statistics column name format( "column" )
);
New Column( "height M", Formula( If( :sex == "M", :height ) ));
New Column( "height F", Formula( If( :sex == "F", :height ) ));
p2=d1<< Graph Builder(
Transform Column( "age_F", Nominal, Formula( If( :sex == "F", :age ) ) ),
Transform Column( "age_M", Nominal, Formula( If( :sex == "M", :age ) ) ),
Size( 433, 323 ),
Show Control Panel( 0 ),
Summary Statistic( "Median" ),
Graph Spacing( 4 ),
Variables(
X( :height F ),
X( :height M ),
Y( :age_M, Combine( "Merged" ) ),
Y( :age_F, Position( 1 ), Combine( "Merged" ) ),
Color( :N Rows )
),
Relative Sizes( "X", [360 237] ),
Elements( Position( 1, 1 ), Bar( X, Y( 2 )) ),
Elements( Position( 2, 1 ), Bar( X, Y( 1 ) ) ),
SendToReport(
Dispatch( {}, {:height F}, ScaleBox, {Max( 800 ), Inc( 100 ), Minor Ticks( 0 )} )
));
rpt = p2 << Report;
frames = rpt << XPath( "//FrameBox" );
For( i = 1, i <= N Items( frames ), i++,
frames[i] << Set Graphlet(
Picture(
try(Close(d2,nosave));
current data table(dt);
d2=dt<<Subset(Output Table("B00"),Selected Rows(0),Rows(dt<<Get Selected Rows()),Selected columns only(0));
),
Reapply(1)
)
);