ms609 / Ternary

Create ternary plots in R
https://ms609.github.io/Ternary/
32 stars 3 forks source link

Feature request: Colorbar #66

Closed mnlang closed 1 year ago

mnlang commented 1 year ago

Hi Martin

I am trying to create a colorbar for a "ColourTernary" plot. I don't think this is currently supported, is it? If not, it would be great to have that feature or I could also create one in R myself, however, I don't really know the exact breaks you are using in the "ColourTernary" plot.

For reference, see also this stackoverflow question with a request for a colorbar (not by me).

Would be great to hear from you and thanks for the nice package! Best, Moritz

ms609 commented 1 year ago

Hi Moritz, thanks for the question, this shouldn't be too difficult to implement, I'll have a think about the best approach and get back to you once I have the opportunity, hopefully in the next couple of weeks.

Martin

mnlang commented 1 year ago

Hi Martin

This sounds great - thanks a lot and please keep me updated! In case it's too much work, an e.g., invisible return of the exact breaks used would be already very helpful!

All the best, Moritz

ms609 commented 1 year ago

I've posted an SO answer and added an example to the vignettes (see §Contours).

Before the next release I indend to:

How does this work out for you – are there ways that this could be improved?

ms609 commented 1 year ago

Having put a bit of time into developing a solution here (spawning the "PlotTools" package, now on CRAN) I have attempted a native implementation in ColourTernary(), available in v2.1.3.9003 and coming soon to CRAN.
Documentation is available at https://ms609.github.io/Ternary/dev/reference/ColourTernary.html .