smoothLegend {DASplusR} | R Documentation |
Adds a legend to an existing smoothing map.
smoothLegend(dataset,x,y,var,resol=200, type=c("contin","percentile"), whichcol=c("gray","rainbow","rainbow.trunc", "rainbow.inv","terrain","topo") qutiles=c(0,0.05,0.25,0.50,0.75,0.90,0.95,1), leg.title="",leg.title.cex=0.7,leg.numb.cex=0.7,leg.round=2, leg.position.x,leg.position.y,size,xMin=NA,xMax=NA, yMin=NA,yMax=NA,x.log=FALSE,y.log=FALSE)
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 |
resol |
numeric; the resolution of the grid for the interpolation |
type |
character; 'percentile' or 'contin' |
whichcol |
character; color scheme - one of the following: 'gray', 'rainbow', 'rainbow.trunc', 'rainbow.inv', 'terrain', 'topo' |
qutiles |
numeric; the percentiles (divided by 100) in which breakpoints for the colors are taken |
leg.title |
character; a string specifying the legend title |
leg.title.cex |
numeric; a numerical value giving the amount by which legend title should be scaled relative to the default |
leg.numb.cex |
numeric; a numerical value giving the amount by which legend values should be scaled relative to the default |
leg.round |
numeric; number of digits of the legend values |
leg.position.x |
numeric; x-coordinate of the legend |
leg.position.y |
numeric; y-coordinate of the legend |
size |
numeric; a factor giving the amount by which the legend should be scaled relative to the default |
xMax |
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-axis |
y.log |
logical; TRUE if logarithmic y-axis |
The function 'smoothLegend' adds a legend to an interpolated map created with 'smoothingMap' at the location specified with leg.position.x and leg.position.y.
If 'type' is 'percentile' the break points of the color are given by the percentings given by 'qutiles'. If 'type' is conti the break points are somewhat continous.
'plotlegend', 'growingDotLegend'
require(DASplusR7) DefaultSymbolSets() data(KOLA95_C2MM) smoothingMap(dataset=KOLA95_C2MM,x="XCOO",y="YCOO", var="Al",title="",xlabel="",ylabel="",cex.xlab = "1", cex.ylab="1",font.xlab="1",font.ylab="1", margin=c(2,2,2,2)+0.1,xMin=NA,xMax=,yMin=NA,yMax=NA, x.log=FALSE,y.log=FALSE,frame=TRUE,type="percentile", whichcol="topo",border=bor, qutiles=c(0,0.05,0.25,0.5,0.75,0.9,0.95,1),resol=400) axis(1,labels=TRUE,font=1,cex.axis=1) axis(2,labels=TRUE,font=1,cex.axis=1) smoothLegend(dataset=KOLA95_C2MM,x="XCOO",y="YCOO", var="Al",whichcol="topo",resol=400, qutiles=c(0,0.05,0.25,0.5,0.75,0.9,0.95,1), type="percentile",leg.title="Al [mg/kg]", leg.position.x=798670,leg.position.y=7751584, size=1,leg.title.cex=0.7,xMin=NA,xMax=NA,yMin=NA, yMax=NA,x.log=FALSE,y.log=FALSE) scalebar(770333,7376258,min="0",middle="50",max="100", unit="km",title="") northarrow(360157,7820700,360157,7889816,360157,7855695)