figAdd {GCDkit}R Documentation

Plot editing: Add

Description

These functions enable adding new components to Figaro-compatible plots.

Usage

figTicks(major=-0.5, minor=0.25, xmjr=NULL, xmin=NULL, ymjr=NULL, ymin=NULL)

figGrid(lty="dotted", col="gray30")    
    
figLegend()

figAddReservoirs(autoscale=FALSE, var.name=NULL, sample.names=NULL,
reserv.condition=NULL, labs=NULL, pch="*", col="darkred", cex=1.5, type="p",...)

figAddText()

figAddArrow()

figAddBox()

figAddFit()

figAddCurve(equation=NULL)

Arguments

major

length of the major tick marks.

minor

length of the minor tick marks.

xmjr, ymjr

intervals for the major tick marks.

xmin, ymin

intervals for the minor tick marks.

lty

grid line type.

col

plotting colour.

autoscale

logical; should be the scaling changed so that all the overplotted values are shown?

var.name

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

sample.names

character vector; names of reservoirs, ideal minerals or samples to be plotted.

reserv.condition

text; regular expression specifying reservoirs compositions of which are to be plotted.

labs

text; optional abbreviated labels for the individual reservoirs

pch

plotting symbol.

cex

numeric; relative size of the plotting symbol.

type

character; plot type; see plot.default.

...

additional parameters to the plotting function. See figOverplot.

equation

text; equation expressed as a function of x; see curve.

Details

'figTicks' adds major and minor tick marks for the x and y axes. Their length is specified as a fraction of the height of a line of text. Negative numbers imply outward and positive inward pointing ticks. The user is prompted for four numbers separated by commas, xmjr, xmin, ymjr, ymin. These specify the intervals of major and minor ticks for x and y axes, respectively. Not implemented to logarithmic plots and spiderplots yet.

'figGrid' adds grid lines for x and/or y axes.

'figLegend' adds legend(s) on specified location.

'figAddReservoirs' overplots compositions of selected geochemical reservoirs (from the file 'reservoirs.data', see selectNorm for the file structure as well as relevant references) or ideal minerals (from the file 'idealmins.data'). Alternatively, if the name of a numeric matrix or dataframe in the global environment is provided via the argument 'var.name', the selection of data from this object is used (see Examples). The selection is specified by either 'sample.names' or by 'reserv.condition' parameters. Optional parameter 'labs' can specify alternative, perhaps abbreviated textual labels to the points plotted. Please note that this function is available so far for spiderplots, binary and ternary plots only.

'figAddText' adds text on specified location. The parameters are the text style ('n' = normal, 'b' = bold, 'i' = italic and 'bi' = bold italic), colour and relative size.

'figAddArrow' adds arrow on specified location. The parameters are colour and line style ('solid', 'dashed', 'dotted' and 'dotdash').

'figAddBox' adds box on specified location (click bottom left and then top right corner).

'figAddFit' adds either a single least-squares fit to all data, or several fit lines, for each of the groups separately. The parameters are colour and line style ('solid', 'dashed', 'dotted' and 'dotdash'). The equation of each fit line is plotted at the user-defined location.

'figAddCurve' adds a curve, specified as a function of variable 'x'. The parameters are colour and line style ('solid', 'dashed', 'dotted' and 'dotdash').

The colours can be specified both by their code (see table under menu 'Data handling|Show available colours') or R name (see Examples).

The additional two menu items, available for binary and ternary plots, allow adding contours or convex hulls outlining individual groups of data. See contourGroups and chullGroups.

Value

For 'figAddReservoirs', a numeric matrix with the overplotted analyses from the reference dataset.

Warning

Most of these functions serve to adding some extra components/annotations immediately before the graph is printed/exported. Note that, except for 'figAddReservoirs', all user-defined components added via 'Plot editing: Add' will be lost upon redrawing, zooming ....

Author(s)

Colin M. Farrow, colinfarrow537@gmail.com

and Vojtech Janousek, vojtech.janousek@geology.cz

See Also

'par' 'showColours' 'colours' 'figaro' 'selectNorm' 'contourGroups' 'chullGroups' 'figOverplot' 'curve'

Examples

    binary("Zr/Nb","Ba/La")
    # Sun & McDonough mantle reservoirs, Taylor & McLennan 1995 Upper and Lower Crust
    reserv<-c("MORB|OIB .* McDonough","Upper .* 1995","Lower .* 1995") 
    reserv.names<-c("NMORB","EMORB","OIB","UCC","LCC") 
    figAddReservoirs(TRUE,"reservoirs.data",reserv.condition=reserv,labs=reserv.names)
    figTicks(major=-0.5, minor=0.25,10,1,10,1)
    
    ternary("SiO2/10","MgO","FeOt")
    figAddReservoirs(var.name="idealmins.data",sample.names=c("Or","Bt","Ph")) 
    
    spider(WR,"NMORB..Sun",field=TRUE,colour="gray",field.colour=T,ymin=0.1,ymax=100)
    figAddReservoirs(var.name="reservoirs.data",reserv.condition="Continental Crust",
        autoscale=TRUE,col=c("red","black","darkblue"),pch=1:3) 

[Package GCDkit version 4.1 Index]