Hello, I've encountered an interesting situation and can't seem to find an applicable solution. I've got a multivariate synthetic dataset I generated in order to explore various statistical techniques. In my dataset I vary three things, sample size, effect size, and the number of variables that are affected. As these are varied I've output my results into a three dimensional array. So for each possible combination, think xyz location, I have an output value. What I would like to do is to create a somewhat unique style of plot very similar to a triangular soil texture plot, excepting that at rather than dropping a point at a given coordinate, I have all possible coordinates on the grid, and I would like to overlay a color map in which combinations that yield high values shade towards one color, and low values another or some other such color scheme. Thus displaying under what conditions certain accuracies are achieved for the test. I've explored both the soil texture plotting solutions in R, and as best I can with little background in image work the 3d plotting solutions offered by various packages. I haven't found anything that seems to be able to handle an array this way. I was wondering if anyone could point me in the right direction. P~ [[alternative HTML version deleted]]
A triangular plot can represent three dimensions in a two dimensional plane because the three dimensions are constrained by the fact that they sum to 100% (e.g. sand/silt/clay composition of a soil). That does not seem to apply to your example. It sounds like you might need a 3d contour plot. You might look at package misc3d, function countour3d. See the R Graphical Manual for some examples: http://rgm3.lab.nig.ac.jp/RGM/R_image_list?package=misc3d Alternatively you can use lattice to draw 2d contours for a series of slices. That may not be as snazzy, but it will probably be easier to interpret. ------------------------------------- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77840-4352 -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of White, William Patrick Sent: Monday, July 29, 2013 1:54 PM To: r-help at R-project.org Subject: [R] triangular color plot of array Hello, I've encountered an interesting situation and can't seem to find an applicable solution. I've got a multivariate synthetic dataset I generated in order to explore various statistical techniques. In my dataset I vary three things, sample size, effect size, and the number of variables that are affected. As these are varied I've output my results into a three dimensional array. So for each possible combination, think xyz location, I have an output value. What I would like to do is to create a somewhat unique style of plot very similar to a triangular soil texture plot, excepting that at rather than dropping a point at a given coordinate, I have all possible coordinates on the grid, and I would like to overlay a color map in which combinations that yield high values shade towards one color, and low values another or some other such color scheme. Thus displaying under what conditions certain accuracies are achieved for the test. I've explored both the soil texture plotting solutions in R, and as best I can with little background in image work the 3d plotting solutions offered by various packages. I haven't found anything that seems to be able to handle an array this way. I was wondering if anyone could point me in the right direction. P~ [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org 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.
On 07/30/2013 04:54 AM, White, William Patrick wrote:> Hello, > I've encountered an interesting situation and can't seem to find an applicable solution. I've got a multivariate synthetic dataset I generated in order to explore various statistical techniques. In my dataset I vary three things, sample size, effect size, and the number of variables that are affected. As these are varied I've output my results into a three dimensional array. So for each possible combination, think xyz location, I have an output value. What I would like to do is to create a somewhat unique style of plot very similar to a triangular soil texture plot, excepting that at rather than dropping a point at a given coordinate, I have all possible coordinates on the grid, and I would like to overlay a color map in which combinations that yield high values shade towards one color, and low values another or some other such color scheme. Thus displaying under what conditions certain accuracies are achieved for the test. > I've explored both the soil texture plotting solutions in R, and as best I can with little background in image work the 3d plotting solutions offered by various packages. I haven't found anything that seems to be able to handle an array this way. I was wondering if anyone could point me in the right direction. > P~ >Hi William, If you haven't looked at the triax.fill function in the plotrix package, that might be helpful. I'm not sure what resolution you want on the plot, but triax.fill will display colors down to a few pixels. Jim