Add contours {GCDkit}R Documentation

Add contours

Description

Superposes contour lines to a Figaro-compatible plot.

Usage

addContours(GUI = FALSE, bandwidth = "auto",...)

Arguments

GUI

logical; is the function called from GUI (or in a direct mode)?

bandwidth

vector of bandwidths for x and y directions provided to the function kde2d. See Details.

...

additional parameters passed to the underlying function contour. Typically plotting parameters.

Details

This is, in principle, a front end to the standard R function contour. It will work on both the stand-alone Figaro-compatible plot or a plate thereof.

The bandwidth should be a positive number or 'auto', whereby the higher value corresponds to a smoother result. The necessary calculations are done by the function kde2d.

Additional parameters passed to the underlying function contour may include levels, a vector of numbers 0-1 which are percentages of samples falling outside of the given contour. The logical parameter drawlabels then determines whether the individual contour lines are to be labeled, or not.

Value

None.

Author(s)

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

See Also

'filled.contour' 'kde2d' 'par' 'figaro'

Examples

    sampleDataset("atacazo")

    # single plot
    binary("SiO2","MgO")
    addContours(col="darkblue",lty="dashed",bandwidth=1.5)
    
    figRedraw()
    addContours(lty="solid",bandwidth=1.5, levels=c(0.01,0.1), col=1:2)
    
    figRedraw()
    addContours(lty="solid",bandwidth=1.5, levels=c(0.01,0.1), col=1:2,drawlabels=FALSE)

    windows()
    figRedraw()
    addContours(col="darkgreen",lty="dotted",bandwidth=5)
    
    # multiple plot
    multiple("SiO2","Al2O3,MgO,CaO,K2O")
    plateCex(2)
    plateCexLab(1.5)
    addContours(col="darkgreen",lty="dashed")   

[Package GCDkit version 6.3.0 Index]