showLegend {GCDkit}R Documentation

Display legend

Description

Displays a graphical legend(s) with assignment of plotting symbols and colours used by majority of the diagrams.

Usage

    showLegend(pch = labels$Symbol, col = labels$Colour, new.plot = TRUE,
    x = "topright", y = NULL, alt.leg = FALSE, just.colours = FALSE, GUI = FALSE, ...)

Arguments

pch

numeric or character: plotting symbols.

col

numeric: code for their colour.

new.plot

logical: shall be opened a new plotting window for the legend?

x,y

coordinates for the legend.

alt.leg

logical; should be the alternative (continuous) legend shown? See details.

just.colours

logical; in cases when two legends would be created, should be only that for plotting colours shown?

GUI

logical; Is the function called from GUI (and not batch mode)?

...

any additional parameters for the function legend.

Details

The internal variables 'leg.col' and 'leg.pch' are set to zero, if the current assignment is on the basis of 'groups'. Otherwise they contain the sequential number(s) of column(s) in the data frame 'labels' whose levels are to be used to build the legend(s).

If both variables differ, two legends are created, for plotting symbols and colours separately. This is done unless 'just.colours' is set, when only legend for colours is displayed.

If both variables equal zero, the current grouping information is used.

If a complete colour scale is used for plotting symbols, for instance that created by the assignColVar function, an alternative (continuous) legend can be drawn.

Symbols and colours by a single label can be assigned by functions assignSymbLab and assignColLab respectively, symbols and colours by groups simultaneously by assignSymbGroup. Symbols can be colour-coded according to a variable using the function assignColVar. Uniform symbols are obtained by assign1symb, uniform colours by assign1col. Table of available plotting symbols is displayed by showSymbols and colours by showColours.

Value

None.

Author(s)

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

See Also

legend figLegend

Examples

    data(sazava)
    accessVar("sazava")
    groupsByLabel("Intrusion")
     
    plotDiagram("DebonPQ",FALSE,TRUE)
    
    showLegend(x="topleft",bg="pink",new.plot=FALSE)
    
    showLegend(x="bottomleft",bg="#AAAAAAAA",new.plot=FALSE) # Semitransparent
    
    showLegend(x=10,y=100,bg="khaki",new.plot=FALSE)    

[Package GCDkit version 6.1 Index]