Dear all, I found a wonderful package (vcd) able to plot ternary diagrams, i.e. ternaryplot (thanks D. Meyer). The problem is that one of three variable has negative values. If I use the ternaryplot function but some points are outside the triangle, as value en negative. Is it possible to make the ternary diagram fit exactly the cloud points ? Regards ------------------------------------------------ Emmanuel Poizot Cnam/Intechmer B.P. 324 50103 Cherbourg Cedex Phone (Direct) : (00 33)(0)233887342 Fax : (00 33)(0)233887339 ------------------------------------------------
There are also the functions: triangle.plot in package ade4, triplot in package TeachingDemos, tri in package cwhtool, and soil.texture in package plotrix. Perhaps one of these other functions will work better for you (all do the triangular plots, each with different bells and whistles). triplot from TeachingDemos has an option to add to an existing plot (the idea being that you already created one triplot and are now adding more points/lines to it). You could set up your own plot and axes then use triplot with add=TRUE to plot your points. If none of those work for you then you could look at the source code of any of them to see what modifications would help. 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 Poizot Emmanuel Sent: Thursday, May 18, 2006 7:05 AM To: r-help at stat.math.ethz.ch Subject: [R] Negative value on ternaryplot Dear all, I found a wonderful package (vcd) able to plot ternary diagrams, i.e. ternaryplot (thanks D. Meyer). The problem is that one of three variable has negative values. If I use the ternaryplot function but some points are outside the triangle, as value en negative. Is it possible to make the ternary diagram fit exactly the cloud points ? Regards ------------------------------------------------ Emmanuel Poizot Cnam/Intechmer B.P. 324 50103 Cherbourg Cedex Phone (Direct) : (00 33)(0)233887342 Fax : (00 33)(0)233887339
Ternary plots are typically used to plot triplets of values (e.g. composition of 3 components) that add up to 100% or 1. In this context, I am not sure what a negative value means. Do the 3 numbers in your application still add up to 100%? Alternatively, would it be meaningful to translate the data along the dimension with negative values to shift them to the positive quadrant? -Christos -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Greg Snow Sent: Thursday, May 18, 2006 2:37 PM To: Poizot Emmanuel; r-help at stat.math.ethz.ch Subject: Re: [R] Negative value on ternaryplot There are also the functions: triangle.plot in package ade4, triplot in package TeachingDemos, tri in package cwhtool, and soil.texture in package plotrix. Perhaps one of these other functions will work better for you (all do the triangular plots, each with different bells and whistles). triplot from TeachingDemos has an option to add to an existing plot (the idea being that you already created one triplot and are now adding more points/lines to it). You could set up your own plot and axes then use triplot with add=TRUE to plot your points. If none of those work for you then you could look at the source code of any of them to see what modifications would help. 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 Poizot Emmanuel Sent: Thursday, May 18, 2006 7:05 AM To: r-help at stat.math.ethz.ch Subject: [R] Negative value on ternaryplot Dear all, I found a wonderful package (vcd) able to plot ternary diagrams, i.e. ternaryplot (thanks D. Meyer). The problem is that one of three variable has negative values. If I use the ternaryplot function but some points are outside the triangle, as value en negative. Is it possible to make the ternary diagram fit exactly the cloud points ? Regards ------------------------------------------------ Emmanuel Poizot Cnam/Intechmer B.P. 324 50103 Cherbourg Cedex Phone (Direct) : (00 33)(0)233887342 Fax : (00 33)(0)233887339 ______________________________________________ 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
Poizot Emmanuel wrote:> Dear all, > I found a wonderful package (vcd) able to plot ternary diagrams, i.e. > ternaryplot (thanks D. Meyer). > The problem is that one of three variable has negative values. > If I use the ternaryplot function but some points are outside the > triangle, as value en negative. > Is it possible to make the ternary diagram fit exactly the cloud points ? > Regards >Hi Emmanuel, As Christos has already pointed out, triangle/ternary plots are intended to display triplets of values that add up to a constant. Negative numbers stretch the definition a bit. One could take triax.plot from plotrix and rejig the code to have the axes running from -0.5 to 1.5. This might appear to work, but the interpretation of such a plot would be difficult at best. Perhaps you want a 3D plot of some type like scatterplot3D? Jim