[R] triangle contour plots

Jim Lemon jim at bitwrit.com.au
Tue Jun 19 12:52:26 CEST 2007


Robin Hankin wrote:
> Suppose I have three numbers p1, p2, p3 with
> 0 <= p1,p2,p3 <= 1  and p1+p2+p3=1,
> and a  function  f=f(p1,p2,p3)   =  f(p1,p2,1-p1-p2).
> 
> How to draw a contour plot of f() on the p1+p2+p3=1 plane,
> that is, an equilateral triangle?
> 
> Functions triplot(), triangle.plot(), and ternaryplot()  give
> only  scatterplots, AFAICS
> 
Hi Robin,
I was all ready to say that triax.plot could do what you want if I added 
a "type" argument, but found that for some reason both "points" and 
"lines" are only reading the first color in a vector. If I send more 
than one color to either function, I only get the first one. If I can 
sort this out, it's easy to use triax.plot to do what you want (unless, 
of course, you are satisfied with lines of one color).

Jim



More information about the R-help mailing list