ternary {GCDkit}R Documentation

Ternary plot

Description

These functions plot/add data to a ternary plot.

Usage

ternary(x = NULL, y = NULL, z = NULL, samples = rownames(WR), 
    new = TRUE, grid = FALSE, ticks = TRUE, ...)

triplot(aa, bb, cc, alab, blab, clab, title = "", grid.int = 0, 
tick.int = 0, label.axes = FALSE, line = FALSE, 
pch = labels[names(aa), "Symbol"], 
col = labels[names(aa), "Colour"],identify = getOption("gcd.ident"),
new = TRUE,...)

triplotadd(aa, bb, cc,
pch=labels[names(aa),"Symbol"],
col=labels[names(aa),"Colour"], 
identify = FALSE, lines = FALSE, lty = "solid")

Arguments

x

character; specification of the plotting variable for the bottom left apex (formulae OK).

y

character; specification of the plotting variable for the top apex (formulae OK).

z

character; specification of the plotting variables for the bottom right apex (formulae OK).

grid

logical; should be grid plotted?

ticks

logical; should be ticks plotted?

samples

character or numeric vector; specification of the samples to be plotted.

new

logical; should be opened a new plotting window?

...

Further parameters to the functions 'ternary' and 'triplot'.

aa

a numerical vector, bottom left apex.

bb

a numerical vector, top apex.

cc

a numerical vector, bottom right apex.

alab,blab,clab

labels for the apices.

title

title for the whole diagram.

grid.int

interval of grid lines (0-1); if set to zero (default value), no grid is drawn.

tick.int

interval of ticks on axes (0-1); if set to zero (default value), no ticks are drawn.

label.axes

logical; if set to TRUE, axes are labeled by percentages of the components.

line, lines

logical; if set to TRUE, lines are drawn instead of plotting points.

lty

line type.

pch

plotting symbols.

col

plotting colours.

identify

logical; should be samples identified?

Details

The function 'ternary' is the user interface to 'triplot'. The latter sets up the axes, labels the apices, plots the data and, if desired, enables the user to identify the data points interactively.

If 'new=TRUE', new plot window is opened.

The values for 'label.axes' are chosen according to 'tick.int' or 'grid.int'; if these are not available, labels are drawn by 10%.

'triplotadd 'adds data points/lines to pre-existing ternary plot.

The variables to be plotted are selected using the function 'selectColumnLabel.

In the specification of the apices can be used also arithmetic expressions, see calcCore for the correct syntax.

The functions are Figaro-compatible.

Value

A numeric matrix with coordinates of the data points recast to a sum of 1.

Author(s)

Jakub Smid smid@prfdec.natur.cuni.cz & Vojtech Janousek, vojtech.janousek@geology.cz

See Also

plot

Examples

ternary("Ba","Rb","Sr",col="red",pch="+")

ternary("SiO2/10","2*FeOt","K2O",samples=1:10,grid=TRUE)   
    
triplot(WR[,"SiO2"],WR[,"Na2O"]+WR[,"K2O"],WR[,"MgO"],"SiO2","A","MgO",
tick.int=0.1)

triplot(WR[,"Rb"]/10,WR[,"Sr"],WR[,"Ba"],"Rb","Sr","Ba",tick.int=0.05,
grid.int=0.1,pch="+",col="darkblue",label.axes=TRUE)

[Package GCDkit version 3.00 Index]