Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: adding alpha parameter to TernaryPoints #91

Open
svalenzl opened this issue Oct 21, 2024 · 1 comment
Open

Suggestion: adding alpha parameter to TernaryPoints #91

svalenzl opened this issue Oct 21, 2024 · 1 comment

Comments

@svalenzl
Copy link

Apologies if the option already exists, I could not find how to add an alpha option to increase the visibility of the points that overlap. Thanks for this useful package.

@ms609
Copy link
Owner

ms609 commented Oct 21, 2024

Thanks for the query. I've tried to keep functions such as TernaryPoints as consistent with the corresponding graphics functions (here, points) as possible. So the best way to achieve what you're looking to do as things stand is given in an example at:

https://ms609.github.io/Ternary/articles/Ternary.html#plot-two-stylised-plots-side-by-side-and-plot-data

AddToTernary(graphics::points, data_points, pch = 21, cex = 2.8, 
             bg = vapply(data_points, 
                         function (x) rgb(x[1], x[2], x[3], 128,
                                          maxColorValue = 255),
                         character(1))
             )

If you don't need points to be different colours, you could do something simpler like TernaryPoints(data_points, col = rgb(0, 0, 0, alpha = 0.8))

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants