Hi, I know how to enable Labels for Heatmaps:the labels are nicely aligned with the heatmap cells and the values correspond to the column values which are used as color.
I also know how to enable labels for point plots - where the labels can be chosen independent of the "color" column:
Is it possible to combine both approaches:
Heatmap labels, where a column is used as labels which is NOT THE SAME as the column used for color?
Application case:
use a meaningful, normalized value as color [e.g. mortality rate] - but show the actual counts [e.g. Covid 19 victims] as labels.
Add-on question: is it possible to use Character Labels?
e.g. a combination of
and
... something like:
so, similar to adding point labels to a heatmap plot, but with the text nicely confined to the heatmap cells?
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Formula Column(
Operation( Category( "Distributional" ), "Rank" ),
Columns( :height ),
Group By( :age, :sex )
);
dtsplit = dt << Split(
Split By( :"Rank[height][age,sex]"n ),
Split( :name ),
Group( :age, :sex ),
Remaining Columns( Drop All )
);
dtCombine = dtsplit << Combine Columns(
columns( :"1"n, :"2"n, :"3"n, :"4"n, :"5"n, :"6"n, :"7"n ),
Column Name( "Students" ),
Delimiter( "," )
);
New Column( "N_students",
Formula( N Items( Words( :Students, "," ) ) )
);
Graph Builder(
Variables( Y( :age ), Group X( :sex ), Color( :N_students ) ),
Elements( Heatmap( Y ) )
);
dtCombine << Split(
Split By( :sex ),
Split( :Students ),
Group( :age ),
Remaining Columns( Drop All )
)