ms609 / Ternary

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

Turn off auto-scale? #83

Open arw36 opened 7 months ago

arw36 commented 7 months ago

Does the ternary plot auto scale the three variables? I'm dropping some other variables so I can focus on the top three. So for a few points, there will be a <100 sum across the three. But it seems to be auto pushing my 70,0,0 to 100,0,0.

Thanks - this is a cool package and exactly what I was looking for.

image

ms609 commented 7 months ago

Yes, it auto-scales to a 100% sum; if there are other components, points are in effect projected onto a plane of the higher-dimensional hypertetrahedron (?) corresponding to all available dimensions.

There is more than one way to make this projection; what is your desired behaviour in the case you describe?

arw36 commented 6 months ago

My desired behavior is on the triangle plot if given values (60, 20, 10) that it accurately positions at 60,20,10 even though these do not sum to 100. This effectively eliminates the 10 value that may go to another category not shown on the triangle plot. In my case, I am focused on diet items from arthropoda, chordata, and arthropoda and eliminating all other categories, but do not want to rescale these categories in relation to only each other.

ms609 commented 6 months ago

60, 20, 10 does not correspond to a position on the triangle. Perhaps you could show on an image where you would like this point to plot?

arw36 commented 6 months ago

I guess a more extreme would be 60, 0, 0 which I see as the blue dot. I would suspect a 60,20,10 to look something like the red dot.

example

A separate goal, was to have the inset triangle which would show no single category comprises >60 value, but I also don't think that accurately visualizes this boundary.

ms609 commented 6 months ago

60, 0, 0 is probably a clearer case to start with. What is the basis for plotting 60, 0, 0 at 50, 50, 0 rather than (say) 50, 0, 50?

arw36 commented 6 months ago

Oops, that was an error. It was meant to be, I guess, by that coordinate system 60,40,0. (I just put right at 60 on the axis, ignoring this intersection actually means with 40 input from another category? Can you show the alternative option?

arw36 commented 6 months ago

I also suspect, since I'm violating the"sum to a constant" it may not be appropriate....

ms609 commented 6 months ago

60, 0, 40 would correspond to the green circle: image

arw36 commented 6 months ago

Yes, I guess I can either clarify the incompleteness of the sample by using a pie chart or size-variation/color as the point marker or I could just use a full cartesian plot since my points aren't restricted to this plane.

Thanks for your help.

arw36 commented 6 months ago

Perhaps a warning message mentioning the re-scaling would be helpful? Is the default to rescale or drop values? And can you change this preference?