User Request – Disable Limiting Region
The other week a user of ggtern ran into a problem where they wanted to use the limit_tern(...)
functionality, however there were a few marginal points / paths that extended beyond the limiting region. Under normal circumstances, the standard ggtern behaviour is to strip these points, which can interfere with the desired outcome if they are part of a continuous path or polygon etc…
This is best demonstrated with an example:
1 2 3 4 5 6 |
library(ggtern) data(Feldspar) ggtern(data = Feldspar, aes(Ab, An, Or)) + geom_confidence(color="blue",linetype=1) + geom_point() + limit_tern(.85,1,.85) + labs(title = 'Feldspar - Elkins and Grove 1990 + Confidence Levels') |
Which produces the following output:
It is clear in the above that the tail ends get truncated, where truthfully they should flow over the boundaries of the plot region. There is a way to suppress this behaviour, which is to modify an internal global option, tern.discard.external
, as follows:
1 2 3 4 5 6 7 |
library(ggtern) data(Feldspar) options("tern.discard.external" = FALSE) ### NOTE THIS LINE ggtern(data = Feldspar, aes(Ab, An, Or)) + geom_confidence(color="red",linetype=1) + geom_point() + limit_tern(.85,1,.85) + labs(title = 'Feldspar - Elkins and Grove 1990 + Confidence Levels') |
Which produces the following output, noting that the tails (top and right apex corners) now extend beyond past the limiting plot region.
Needless to say that this feature should be used on a discretionary basis, in very specific situations where a minor overflow can be tolerated.





Hi
I was trying to adapt this recipe on a 5-fold validation classification experiment but it seems that I got wrong how to pass the x aesthetics. It seems it is not enough to pass the original data so that ggtern automagically works out the sd?
Plotting the points works great, but I would like to overimpose confidence regions on the mean values for (x,y,z). Is geom_confidence suited to this? Could you provide any pointers (even on ggplot2) on how to do this?
…And thanks for ggtern!
Cheers,
F. Valverde
> ceT ceT
Error in svd(x.cov, nv = 0) : infinite or missing values in ‘x’