figOverplot {GCDkit}R Documentation

Adding data to pre-existing plots

Description

This function allows overplotting new data points onto Figaro-compatible binary or ternary plots, or patterns onto spiderplots. It is most useful in adding selected data from typical geochemical reservoirs (e.g., Upper Continental Crust, MORB ...), ideal mineral compositions, results of petrogenetic modelling or another dataset used for comparison (hitherto referred to as a reference dataset).

Usage

    figOverplot(var.name, mat=NULL, sample.names=NULL, condition=NULL, 
    labs=NULL, autoscale=FALSE, pch="*", col="darkred", cex=1, type="p",...)

Arguments

var.name

text; either 'reservoirs.data', 'idealmins.data' or a name of a global variable.

mat

numeric matrix or dataframe with reference dataset.

sample.names

character vector; names of reservoirs, ideal minerals or samples in the reference dataset.

condition

text; regular expression specifying samples in the reference dataset.

labs

text; optional abbreviated labels for the overplotted data from the reference dataset.

autoscale

logical; should be the scaling changed so that all the plotted analyses are shown?

pch

plotting symbol(s) for the reference dataset.

col

plotting colour(s) for the reference dataset.

cex

numeric; relative size of the plotting symbol(s) for the reference dataset.

type

character; plot type; see plot.default. Not implemented for spiderplots.

...

additional parameters to the underlying plotting function(s). See Details.

Details

This function is invoked by 'figAddReservoirs' to overplot selected compositions from typical geochemical reservoirs (system file 'reservoirs.data') or chemistries of ideal minerals (system file 'idealmins.data'). These come through a numeric matrix or dataframe 'mat. See figAddReservoirs for details.

If called directly, the function is employed to overplot data from the reference dataset, either real-world data or a numeric matrix spanning from petrogenetic modelling. The data originate from a two-dimensional variable in the global environment, whose name is provided via the obligatory argument 'var.name'. Argument 'mat' does not need to be specified here as the data frame/matrix is generated by the function 'figOverplot' itself.

In both cases, the selection from the numeric matrix or dataframe 'mat' is based on a list of all 'sample.names' or on a regular expression yielding them ('condition'). Of course, from this selection, only analyses with data sufficient to be plotted on the current diagram are used.

If neither 'sample.names' nor 'condition' is provided, the sample names can be chosen interactively from a drop-down list.

For plotting are used functions 'points', 'triplotadd' and 'spider' for binary plots, ternary plots and spiderplots, respectively. Argument '...' can supply additional parameters to these underlying functions. NB that thus introduced changes to the plot are likely not to be permanent, i.e. they will be lost upon redrawing, zooming ....

Logical argument 'autoscale' determines whether the plot should be rescaled to accommodate both the original data points and the reference dataset. It does not make sense for a ternary plot.

Optional parameter 'labs' can specify alternative, perhaps abbreviated textual labels to the points plotted.

Value

A numeric matrix with the overplotted analyses from the reference dataset.

Warning

Please note that this function is so far available solely for spiderplots, binary and ternary plots.

Author(s)

Vojtech Janousek, vojtech.janousek@geology.cz

See Also

'figAddReservoirs'

'points' 'triplotadd' 'spider'

'figaro' 'selectNorm' 'par'

Examples

    data(sazava)
    accessVar("sazava")
    
    # Calculate Rayleigh-type fractionation trend
    ff<-seq(1,0.1,-0.1) # F, amount of melt left
    x<-80*ff^(1.2-1)    # cL for three elements, arbitrary D of 1.2, 2.0 and 1.3
    y<-550*ff^(2.0-1)
    z<-1000*ff^(1.3-1)
    my.trend<-cbind(x,y,z)
    colnames(my.trend)<-c("Rb","Sr","Ba")
    rownames(my.trend)<-ff
    
    binary("Rb","Sr",log="xy")
    figOverplot(var.name="my.trend",pch="+",col="blue",autoscale=TRUE,type="o",labs=ff)
    
    ternary("10*Rb","2*Sr","Ba/2")
    figOverplot(var.name="my.trend",pch="+",col="blue",type="o")

[Package GCDkit version 4.1 Index]