- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Adding connecting letters ABOVE data points of a line graph
I have letters from a connecting letters report, my means, and SEMs in columns of a new data table. I've created a line graph with points. As suggested in previous discussion posts I've tried "Set shape column" but as you can see the letters are behind the line and so unreadable. I would like to add the letters as labels floating above the points (so they are legible). How can I adjust what position the letters appear at? Or add the letters a different way? Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
Edit: I did this in JMP18. Not sure if it is exactly the same for JMP16 and I cannot test it out.
From connecting letters report, create a data table
In that table create new column by concatenating all letter columns (also rename it to something better)
Join/update that back to your original table (you might have to change Level column data type to match original)
Create new column which can be used to determine the Y-axis location
Edit the formula if necessary
Set the Letters column to be used as marker
Create your plot. Note how Y-axis has been set and how different variables have been disabled
Adjust the formula as necessary for TEMP (1.01 multiplier works in my data) and rename Y-axis after you are done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
Which JMP version are you using?
I assume shape idea comes from this how does one add letters form a connecting letters report to a graph . Other option is here How to denote letters to mark significant differences in a boxplot? . With the second option you can add use the column as markers and then display plot graph with max summary statistic
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
fit = dt << Oneway(Y(:height), X(:age), All Pairs(1), invisible);
letters_tb = ((Report(fit)[OutlineBox("Connecting Letters Report")]) << child) << child;
tb_letter_cols = Filter Each({col_name}, letters_tb << Get Names,
Starts With(col_name, "~Letter Column ")
);
aa_letters = Associative Array();
For Each({level, idx}, letters_tb[1] << get,
aa_letters[level] = "";
For Each({letter_col, idx_col}, tb_letter_cols,
aa_letters[level] ||= Try((letters_tb[1 + idx_col] << get)[idx], "");
);
);
fit << close window;
dt << New Column("TukeyLetters", Character, Nominal, UseForMarker(1), << Set Each Value(
aa_letters[char(:age)];
));
gb = dt << Graph Builder(
Size(529, 451),
Show Control Panel(0),
Variables(X(:age), Y(:height)),
Elements(
Box Plot(X, Y, Legend(6), Box Style("Solid"), Fences(0)),
Points(
X,
Y,
Legend(7),
Summary Statistic("Third Quartile"),
Error Interval("None")
)
)
);
Then there is the option of using graphic script (or maybe marker draw expression) where you calculate where the text should be. This is the most flexible and complicated option.
Edit: There is one more option. You can create new column which determines the Y-axis for the point plot, then use that as extra column in Y-axis, disable it from everything except from the point plot. In this example height+2 is used as the extra column
And the calculation is just :height + 2. It could be easily made much smarter with Col Max(:height, :age) * 1.01 or something
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
I'm using JMP Pro 16. When you say add the letters as markers, can I do that in the control panel or would it have to be through the script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
I think you can do this without scripting but it will have quite a few steps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
Edit: I did this in JMP18. Not sure if it is exactly the same for JMP16 and I cannot test it out.
From connecting letters report, create a data table
In that table create new column by concatenating all letter columns (also rename it to something better)
Join/update that back to your original table (you might have to change Level column data type to match original)
Create new column which can be used to determine the Y-axis location
Edit the formula if necessary
Set the Letters column to be used as marker
Create your plot. Note how Y-axis has been set and how different variables have been disabled
Adjust the formula as necessary for TEMP (1.01 multiplier works in my data) and rename Y-axis after you are done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
As I already have the letters in a column and don't need to generate them in a model, how would I add the column as a marker?
Perhaps I can create a duplicate using something like this?
Names Default To Here(1);
Weights = Open("jmpprj://contents/Weights.jmp");
Weights << New Column("test", Character, Nominal, UseForMarker(1), << DupCol ("Letters")
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
Actually, your last reply showed me how to set the current column as the marker without scripting. So ignore my last reply.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Adding connecting letters ABOVE data points of a line graph
Thanks! This works very well, and is much quicker than adding them all by hand!
I will second the many suggestions to add connecting letter labels to graph builder in future versions.