Suggestion: Point labels outside of plot with leaders
dan-montocc opened this issue · comments
This can be done "manually", with a little work. You'll need a few functions:
TernaryToXY()
will give the Cartesian coordinates of the points you wish to annotateTernaryXRange()
will give the X coordinates of the edges of the plot (likewise for Y)
You can then use the standard line()
and text()
to add the text where it is desired.
Hope that helps – let me know if a more detailed walk-through would be helpful.
- Martin
Hi Martin,
I can't seem to get the correct object type for TernaryToXY() to run with my data. Would you be able to provide some example code when you have the chance? I have attached my data if it helps to have something to work with. The a-axis is Comp, b-axis is Stress, and c-axis is Rud in the listed variables. I would like to be able to label using the Number or ID variable if possible.
Thank you once again for your help and awesome package!
Hi @dan-montocc your figure looks great. Can you please point me in the direction of the functions to generate ticks against points and the labels color separated? Also, is there an ggrepel equivalent for keeping the labels separate? Many thanks.
I should hopefully have time to assemble a worked example next week... watch this space!
I suspect that the missing instruction was that you need to t()
the data frame before passing it to TernaryToXY()
. I can't remember why this function needs the data in this orientation – perhaps it was a naive design decision by me...
You can now find a full worked example at
https://ms609.github.io/Ternary/dev/articles/annotations.html