Hi All, I have 3 variables which present a perfect linear dependency such that the third is the sum of the first two. I have an ordinary 2D contour plot on a square grid with the first two variables forming the axes and the third naturally being the diagonals. From an interpretive point of view it would be nice to plot these two variables on a finer grid such that the third can have the same scaling (i.e. a finer grid) as the first two and this would look better on a triangular mesh. Is this possible in R? Many thanks, Roary -- View this message in context: http://r.789695.n4.nabble.com/Contour-plot-on-a-triangular-mesh-tp4313098p4313098.html Sent from the R help mailing list archive at Nabble.com.
Not sure if I understand the question: If you have more data the grid produced by image() or contour() will be finer anyway... Perhaps we just need an example what you are actually asking for. Uwe Ligges On 20.01.2012 13:28, Roary wrote:> Hi All, > > I have 3 variables which present a perfect linear dependency such that the > third is the sum of the first two. I have an ordinary 2D contour plot on a > square grid with the first two variables forming the axes and the third > naturally being the diagonals. From an interpretive point of view it would > be nice to plot these two variables on a finer grid such that the third can > have the same scaling (i.e. a finer grid) as the first two and this would > look better on a triangular mesh. Is this possible in R? > > Many thanks, > > Roary > > -- > View this message in context: http://r.789695.n4.nabble.com/Contour-plot-on-a-triangular-mesh-tp4313098p4313098.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.
I have two observed categorical variables X1 and X2, with X3=X1+X2, and a continuous response Y. I can interpolate the surface and construct an ordinary 2D square contour plot (with X1,X2 axes and X3 on the diagonal). However, I would like to change the orientation of the plot so that the axes fit a parallelogram shaped grid made up from triangles. This would place X3 on the same scale as X1 and X2 and allow for an easier interpretation of the data for my research question. I hope this makes more sense! Thanks, Roary. Uwe Ligges-3 wrote> > Not sure if I understand the question: If you have more data the grid > produced by image() or contour() will be finer anyway... > Perhaps we just need an example what you are actually asking for. > > Uwe Ligges > > > On 20.01.2012 13:28, Roary wrote: >> Hi All, >> >> I have 3 variables which present a perfect linear dependency such that >> the >> third is the sum of the first two. I have an ordinary 2D contour plot on >> a >> square grid with the first two variables forming the axes and the third >> naturally being the diagonals. From an interpretive point of view it >> would >> be nice to plot these two variables on a finer grid such that the third >> can >> have the same scaling (i.e. a finer grid) as the first two and this would >> look better on a triangular mesh. Is this possible in R? >> >> Many thanks, >> >> Roary >> >> -- >> View this message in context: >> http://r.789695.n4.nabble.com/Contour-plot-on-a-triangular-mesh-tp4313098p4313098.html >> Sent from the R help mailing list archive at Nabble.com. >> >> ______________________________________________ >> R-help@ 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. > > ______________________________________________ > R-help@ 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. >-- View this message in context: http://r.789695.n4.nabble.com/Contour-plot-on-a-triangular-mesh-tp4313098p4314337.html Sent from the R help mailing list archive at Nabble.com.
On 01/20/2012 11:28 PM, Roary wrote:> Hi All, > > I have 3 variables which present a perfect linear dependency such that the > third is the sum of the first two. I have an ordinary 2D contour plot on a > square grid with the first two variables forming the axes and the third > naturally being the diagonals. From an interpretive point of view it would > be nice to plot these two variables on a finer grid such that the third can > have the same scaling (i.e. a finer grid) as the first two and this would > look better on a triangular mesh. Is this possible in R? >Hi Roary, Have a look at the triax.fill function in the plotrix package. Jim
Thanks for your responses Jason and Jim. The ternary plot is definitely the right style with the triangle fill. However, one of the important features (that perhaps I understated) is that X3 will have more categories than X1 and X2, therefore the triangular shape is not appropriate. If X1 has I categories and X2 has J categories, then X3 has I+J-1 categories. Therefore, the overall plot would be in the shape of a parralelogram. Almost like an extended ternary plot... The goal is to view these unbalanced categories on the same scaling as each other... Would this be possible to construct? Thanks again, Roary. Jim Lemon wrote> > On 01/20/2012 11:28 PM, Roary wrote: >> Hi All, >> >> I have 3 variables which present a perfect linear dependency such that >> the >> third is the sum of the first two. I have an ordinary 2D contour plot on >> a >> square grid with the first two variables forming the axes and the third >> naturally being the diagonals. From an interpretive point of view it >> would >> be nice to plot these two variables on a finer grid such that the third >> can >> have the same scaling (i.e. a finer grid) as the first two and this would >> look better on a triangular mesh. Is this possible in R? >> > Hi Roary, > Have a look at the triax.fill function in the plotrix package. > > Jim > > ______________________________________________ > R-help@ 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. >-- View this message in context: http://r.789695.n4.nabble.com/Contour-plot-on-a-triangular-mesh-tp4313098p4315772.html Sent from the R help mailing list archive at Nabble.com.