Learn R Programming

plotrix (version 2.0.3)

triax.plot: Triangle plot

Description

Display a triangle plot with optional grid.

Usage

triax.plot(x=NULL,main="",
 at=list(l=seq(0.1,0.9,by=0.1),r=seq(0.1,0.9,by=0.1),b=seq(0.1,0.9,by=0.1)),
 axis.labels=NULL,tick.labels=NULL,col.axis="black",
 show.grid=FALSE,col.grid="gray",lty.grid=par("lty"),
 show.legend=FALSE,label.points=FALSE,point.labels=NULL,
 col.symbols="black",pch=par("pch"),...)

Arguments

x
Matrix where each row is three proportions or percentages that must sum to 1 or 100 respectively.
main
The title of the soil texture plot. Defaults to nothing.
at
A list with three components, "l", "r" and "b", giving the left, right and bottom tick positions on the three axes.
axis.labels
Labels for the three axes. Defaults to the column names.
tick.labels
Tick labels - a list with three components, "l", "r" and "b", giving the left, right and bottom tick labels. Defaults to argument at (proportions).
col.axis
Color of the triangular axes, ticks and labels.
show.grid
Whether to display grid lines at the ticks.
col.grid
Color of the grid lines. Defaults to gray.
lty.grid
Type of line for the grid.
show.legend
Logical - whether to display a legend.
label.points
Logical - whether to call /code{thigmophobe.labels} to label the points.
point.labels
Optional labels for the points and/or legend.
col.symbols
Color of the symbols representing each value.
pch
Symbols to use in plotting values.
...
Additional arguments passed to points.

Value

  • A list of the x,y positions plotted.

Details

triax.plot displays a triangular plot area on which proportions or percentages are displayed. An optional grid may also be displayed. Note that a three axis plot can only properly display one or more sets of three proportions that each sum to 1 (or percentages that sum to 100). Other values may be scaled to proportions (or percentages), but unless each set of three sums to 1 (or 100), they will not plot properly and triax.plot will complain appropriately.

See Also

triax.points,triax.abline, thigmophobe.labels

Examples

Run this code
data(soils)
 triax.plot(soils[1:10,],main="DEFAULT")
 if(dev.interactive()) par(ask=TRUE)
 triax.plot(soils[1:10,],main="PERCENTAGES",
  tick.labels=list(l=seq(10,90,by=10),r=seq(10,90,by=10),b=seq(10,90,by=10)),
  pch=3)
 main.title<- 
 triax.plot(soils[1:6,],main="GRID AND LEGEND",show.grid=TRUE,
  show.legend=TRUE,col.symbols=1:6,pch=4)
 if(dev.interactive()) par(ask=FALSE)

Run the code above in your browser using DataLab