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(x.int=NULL, y.int=NULL, lty="dotted", col="gray30",GUI=FALSE)    
    
figLegend(x=NULL,y=NULL,bg="#FFFFFFAA",...)

figAddText()

figAddArrow()

figAddBox()

figAddFit(lty="solid",col="black",by.group=FALSE)

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.

x.int

intervals for the grid, x axis component.

y.int

intervals for the grid, y axis component.

GUI

logical; is the function called from GUI?

x,y

coordinates for the legend.

bg

background for the legend.

...

additional parameters to the plotting function. See showLegend and figOverplot, respectively.

lty

line type.

col

plotting colour.

by.group

logical; should be the linear regression performed by groups?

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. See legend and showLegend for further details.

'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'). If using with GUI, 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

None.

Warning

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

Author(s)

Colin M. Farrow, colinfarrow537@gmail.com

Vojtěch Janoušek, vojtech.janousek@geology.cz

See Also

par showColours colours

figaro figAddReservoirs

contourGroups chullGroups legend showLegend

curve

Examples

    sampleDataset("blatna")
    setCex(1.5)

    ## figTicks and figGrid
    binary("Zr/Nb","Ba/La")
    figTicks(major=-0.5, minor=0.25,10,1,10,1)
    figGrid(,5,col="darkblue") # just y axis (second parameter)

    figRedraw()
    figGrid(2,5,col="darkblue")
    
    ## figLegend
    groupsByLabel("Suite")
    figLegend(x="bottomleft",bg="#AAAAAAAA") # Semitransparent
    
   

[Package GCDkit version 6.2.0 Index]