Re: [R] alternate usage of soil.texture (plotrix)

From: Jim Lemon <jim_at_bitwrit.com.au>
Date: Tue, 22 Jul 2008 22:02:48 +1000

On Mon, 2008-07-21 at 07:00 -0700, Dylan Beaudette wrote:
> Hi, I have used the soil.texture() function from the plotrix package
> many times and am very pleased that such a function exists in R. I
> have a slightly different need this time, and need some pointers on
> how to accomplish it. Instead of plotting single symbols on the
> triangle, I would like to outline and fill with a transparent color
> several textural classes. For example, if an area had both loam and
> sandy loam, I would like to draw a polygon around the entire loam and
> sandy loam classes.
>
> Looking at the soil.texture() code, this snippet seems to draw the
> outlines of the texture classes. However, when I try plotting just a
> couple of the segments in these lists I get lines going off the
> original plot.
>
>
> h1 <- c(85, 70, 80, 52, 52, 50, 20, 8, 52, 45, 45, 65,
> 45, 20, 20)/100
> h3 <- c(0, 0, 20, 20, 7, 0, 0, 12, 20, 27, 27, 35, 40,
> 27, 40)/100
> t1 <- c(90, 85, 52, 52, 43, 23, 8, 0, 45, 0, 45, 45,
> 0, 20, 0)/100
> t3 <- c(10, 15, 20, 7, 7, 27, 12, 12, 27, 27, 55, 35,
> 40, 40, 60)/100
> triax.segments(h1, h3, t1, t2, col.lines)
>
>
> Apart from a purely manual approach using locator(), is there any way
> to accomplish what I am trying to do with a slight modification to
> soil.texture() ?

Hi Dylan,
I think that what may be happening is that triax.plot changes the margins on the plot and then restores the margins that were current when triax.plot was called. If you make the original call with the argument:

no.add=FALSE

you will probably find that your lines are now in the correct place.

Jim



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. Received on Tue 22 Jul 2008 - 12:33:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Jul 2008 - 13:32:06 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive