Sorry about that, I missed saving that step. Again here I summarized the table first and then drew the graph using row labels instead of the counts, but this time I actually defined row labels:
Names Default To Here( 1 );
dt = Open( "$Sample_data/big class.jmp" );
random reset(2);
dt << New Column("Age 2", Numeric, "Ordinal", Format("Fixed Dec", 5, 0), Formula(:age[Col Shuffle()]));
dt << Run Formulas;
dt:age << Set Name("Age 1");
dtSum = (sum = dt << Tabulate(
Add Table(
Column Table( Statistics( N ) ),
Row Table( Grouping Columns( :"Age 2"n, :"Age 1"n ) )
)
)) << Make Into Data Table;
dtSum << New Column("Is Diagonal", Numeric, "Nominal", Format("Best", 12), Formula(:Age 1 == :Age 2));
dtSum:N << Label( 1 );
gb = dtSum << Graph Builder(
Size( 525, 450 ),
Show Control Panel( 0 ),
Variables( X( :Age 1 ), Y( :Age 2 ), Color( :Is Diagonal ) ),
Elements( Heatmap( X, Y, Legend( 5 ), Label( "Label by Row" ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Properties( 0, {Fill Color( -15790017 )}, Item ID( "0", 1 ) ),
Properties( 1, {Fill Color( 5 )}, Item ID( "1", 1 ) )
)}
)
)
);