Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>R has an external package called <a href="http://www.math.yorku.ca/SCS/vcd/" rel="nofollow noreferrer">VCD</a> which should do what you want. </p> <p>The documentation is very good (122 page manual distributed w/ the package); there's also a book by the same name, <em>Visual Display of Quantitative Information</em>, by the package's author (Prof. Michael Friendly).</p> <p>To create ternary plots using <strong>vcd</strong>, just call <strong><em>ternaryplot()</em></strong> and pass in an m x 3 matrix, i.e., a matrix with three columns. </p> <p>The method signature is very simple; only a single parameter (the m x 3 data matrix) is required; and all of the keyword parameters relate to the plot's aesthetics, except for scale, which when set to 1, normalizes the data column-wise.</p> <p>To plot data points on the ternary plot, the coordinates for a given point are calculated as the <em>gravity center of mass points</em> in which each feature value comprising the data matrix is a separate <em>weight</em>, hence the coordinates of a point V(a, b, c) are</p> <pre><code>V(b, c/2, c * (3^.5)/2 </code></pre> <p>To generate the diagram below, i just created some fake data to represent four different chemical mixtures, each comprised of varying fractions of three substances (x, y, z). I scaled the input (so x + y + z = 1) but the function will do it for you if you pass in a value for its 'scale' parameter (in fact, the default is 1, which i believe is what your question requires). I used different colors &amp; symbols to represent the four data points, but you can also just use a single color/symbol and label each point (via the 'id' argument). </p> <p><a href="http://www.freeimagehosting.net/uploads/35393eaba5.png" rel="nofollow noreferrer">http://www.freeimagehosting.net/uploads/35393eaba5.png</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload