- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
GraphBuilder Plot: Labels?
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 )
)
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
I was about to request this -- we would use this *all the time*.
[update -- Jarmo showed that JMP already does this -- kudos!]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
With some cheating (manually adding some linebreaks in the table), the best I can offer at the moment:
a combination of heatmap and points.
... unfortunately with the labels placed somehow arbitrarily
There is an entry in the wish list to solve such issues, but unfortunately it got archived
Label Alignment in Graph Builder
dtSplit << Graph Builder(
Variables( Y( :age ), Group X( :sex ), Color( :N_students ) ),
Elements(
Heatmap( Y, Legend( 1 ) ),
Points( Y, Color( 0 ), Legend( 2 ) )
),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
2,
Properties( 0, {Marker Size( 0 )}, Item ID( "age", 1 ) )
)}
)
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
Set column as label and label by row?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
What a wonderful day - it's already there
Quite hidden feature!
The labels don't change when rows or columns get added as labels,
The labels just update when the user switches back and forth the label setting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
So, actually
Names Default to Here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:name << Label( 1 );
Graph Builder(
Variables( X( :sex ), Y( :age ) ),
Elements( Heatmap( X, Y, Label( "Label by Row" ) ) )
)
... will do the job.
Is there a setting to get the entries separated by newlines instead of semicolons?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
Use the earlier script you did use and use \!N as separator
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));
dtsplit << Combine Columns(columns(:"1"n, :"2"n, :"3"n, :"4"n, :"5"n, :"6"n, :"7"n), Column Name("Students"), Delimiter("\!N"));
//dtCombine << get name;
dtsplit << New Column("N_students", Formula(N Items(Words(:Students, "\!N"))));
Column(dtsplit, "Students") << Label(1);
gb = dtsplit << Graph Builder(
Variables(Y(:age), Group X(:sex), Color(:N_students)),
Elements(Heatmap(Y, Legend(1), Label("Label by Row")))
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: GraphBuilder Plot: Labels?
1:0 for JSL vs. GUI
Delimiter("\!N")