boxplotlegend {DASplusR}R Documentation

Legend for boxplot levels

Description

Adds a legend with a boxplot to an existing plot.

Usage

boxplotlegend(dataset,x,y,var,leg.position.x,leg.position.y,
   x.scale,y.scale,legend.title="",cex.legtit=1,
   logscale=FALSE,psymb=c(286,286,305,288,288),
   ssize=c(1.99,1.42,0.3,1,1.4),scolor=c(1,1,1,1,1),
   legend.cex=0.8,xMin=NA,xMax=NA,yMin=NA,yMax=NA,
   x.log=FALSE,y.log=FALSE)

Arguments

dataset a data object of class 'DASData' or 'data.frame'
x character; the object name of the x-coordinate
y character; the object name of the y-coordinate
var character; the object name of the spatial variable
leg.position.x numeric; x-coordinate of the legend
leg.position.y numeric; y-coordinate of the legend
x.scale numeric; half width of the box
y.scale numeric; height of the entire boxplot
legend.title character; legend title
cex.legtit numeric; a numerical value giving the amount by which legend title should be scaled relative to the default
logscale logical; if TRUE logarithmic values are used for calculating the boxplot - the values in the legend are always from the original data
psymb a vector (length greater or equal 5) of plotting character (0-311) to be used for generating the legend
ssize a vector (length greater or equal 5) of the size of the symbols to be used for generating the legend
scolor a vector (length greater or equal 5) of the colors of the symbols to be used for generating the legend
legend.cex numeric; a numerical value giving the amount by which legend text should be scaled relative to the default
xMin numeric; value for the lower bound of the x-coordinate or NA for no boundary
xMax numeric; value for the upper bound of the x-coordinate or NA for no boundary
yMin numeric; value for the lower bound of the y-coordinate or NA for no boundary
yMax numeric; value for the upper bound of the y-coordinate or NA for no boundary
x.log logical; TRUE if logarithmic x-values
y.log logical; TRUE if logarithmic y-values

Details

The function 'boxplotlegend()' adds a legend with symbols specified by psymb, ssize and scolor at the location specified by leg.position.x and leg.position.y.

The legend consists of a boxplot, five symbols (for the lower extreme values, lower whisker, box, upper whisker and upper extreme values) and the values of the borders of these ranges and a title. The boxplot is calculated from var in the dataset. If logscale is TRUE the log values are used. If any boundary of the coordinates given by xMin, xMax, yMin, yMax the boxplot is calculated from the corresponding values.

See Also

'plotlegend','growingDotLegend','SmoothLegend'

Examples

require(DASplusR7)
DefaultSymbolSets()
data(KOLA95_C2MM)
map(dataset=KOLA95_C2MM,x="XCOO",y="YCOO",var="Al",level="Boxplot",
   symbolset="EDA",title="",xlabel="", ylabel="",
   cex.xlab = "1", cex.ylab="1", font.xlab="1", font.ylab="1",
   margin=c(5,4,4,2)+0.1, xMin=NA, xMax=NA, yMin=NA, yMax=NA,
   x.grid=FALSE,x.grid.type=1, x.grid.color=1,x.grid.width=1,
   y.grid=FALSE,y.grid.type=1, y.grid.color=1,y.grid.width=1,
   x.log=FALSE,y.log=FALSE,frame=TRUE)
boxplotlegend(dataset=KOLA95_C2MM,x="XCOO",y="YCOO",var="Al",
   legend.title="Al", logscale=TRUE,
   psymb=c(286,286,305,288,288,286),
   ssize=c(1.99,1.42,0.3,1,1.4,1.99),
   scolor=c("black","black","black","black","black","black"),
   leg.position.x=825048, leg.position.y=7864444,
   y.scale=137794.5,x.scale=12309, legend.cex=0.8,
   xMin=NA,xMax=NA,yMin=NA,yMax=NA)

[Package DASplusR version 0.0-1 Index]