There are a few different ways that this can be accomplished. The most direct way to do this would be to create 2 subsets of the data, dividing the males and females into separate data tables, then plotting them independently, and putting them back together into a new display window.
Here is a script that automates the process, but it can be done interactively as well
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << select where( :sex == "M" );
dtM = dt << Subset(
,selected rows(1),
Selected columns only( 0 )
);
dt << select where( :sex == "F" );
dtF = dt << Subset(
Selected Rows( 1 ),
Selected columns only( 0 )
);
New Window( "Graphs",
Lineup Box( N Col( 2 ), spacing( 0 ),
dtF << Graph Builder(
Size( 533, 447 ),
Show Control Panel( 0 ),
Variables( X( :age, Order By( :height, Descending, Order Statistic( "Mean" ) ) ), Y( :height ) ),
Elements( Bar( X, Y, Legend( 4 ) ) )
),
dtM << Graph Builder(
Size( 533, 447 ),
Show Control Panel( 0 ),
Variables( X( :age, Order By( :height, Descending, Order Statistic( "Mean" ) ) ), Y( :height ) ),
Elements( Bar( X, Y, Legend( 4 ) ) )
)
)
);
Jim