dt = Open( "$sample_data/big class.jmp" );
ages = Data Table( "big class" ) << Summary( Group( :age ), Freq( "None" ), Weight( "None" ) );
sexes = Data Table( "big class" ) << Summary( Group( :sex ), Freq( "None" ), Weight( "None" ) );
Delete Directory( "$temp/myPics" );
Create Directory( "$temp/myPics" );
For( iage = 1, iage <= N Rows( ages ), iage++,
thisAge = ages:age[iage];
For( isex = 1, isex <= N Rows( sexes ), isex++,
thisSex = sexes:sex[isex];
Eval(
Eval Expr(
gb = dt << Graph Builder(
Size( 508, 438 ),
Show Control Panel( 0 ),
Variables( X( :weight ), Y( :height ) ),
Elements( Points( X, Y, Legend( 5 ) ) ),
where( age == Expr( thisAge ) & sex == Expr( thisSex ) )
)
)
);
parentBox = (Report( gb ) << parent)<<parent;
picture = parentBox << getpicture;
picture << saveImage( "$temp/myPics/age" || Char( thisAge ) || "sex" || Char( thisSex ) || ".png", "png" );
// optional: Open( "$temp/myPics/age" || Char( thisAge ) || "sex" || Char( thisSex ) || ".png" );
gb << closewindow;
);
);
Close( ages, "nosave" );
Close( sexes, "nosave" );
Show( Files In Directory( "$temp/myPics" ) );
It looks like you might need to grab the "grandparent" displaybox for graph builder; the parent)<<parent does that to reach out to the where clause in the display tree.
screen capture of large icons of graphs saved by script
Craige