[R] triangle contour plots
Greg Snow
Greg.Snow at intermountainmail.org
Mon Jun 18 17:02:25 CEST 2007
The triplot function in the TeachingDemos package (I don't know about
the one in klaR, or the others mentioned) honors the type='l' argument
and passes it on to points. So if you know where you want the contours
drawn, you can use triplot to draw the lines (it also has an add
argument that could be used to add labels after plotting the lines).
You can also look at the source code to see how the plotting is done and
modify it to do the plot you are interested in.
Hope this helps,
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Robin Hankin
> Sent: Monday, June 18, 2007 6:12 AM
> To: R program
> Subject: [R] triangle contour plots
>
> 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
>
>
>
>
>
> --
> Robin Hankin
> Uncertainty Analyst
> National Oceanography Centre, Southampton European Way,
> Southampton SO14 3ZH, UK
> tel 023-8059-7743
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
More information about the R-help
mailing list