7.3.1 Using Geochemical Maps to Identify a Reasonable Threshold

# Fig 7.2: Map for Cu in O-Horizon
library(StatDA)
data(ohorizon)
data(kola.background)

X=ohorizon[,"XCOO"]
Y=ohorizon[,"YCOO"]


# true representation of x and y axis of map for plot
xwid=diff(range(X))/12e4
ywid=diff(range(Y))/12e4

pdf("fig-7-2.pdf",width=2*xwid,height=1*ywid)
par(mfrow=c(1,2),mar=c(1.5,1.5,1.5,1.5))

### NEW MAP: EDA 5
el=(ohorizon[,"Cu"])

# generate plot with background
plot(X,Y,frame.plot=FALSE,xaxt="n",yaxt="n",xlab="",ylab="",type="n")
plotbg(map.col=c("gray","gray","gray","gray"),add.plot=T)

SymbLegend(X,Y,el,type="percentile",qutiles<-c(0,0.05,0.25,0.75,0.95,1),symbtype="EDA",symbmagn=0.8,
leg.position="topright",leg.title="Cu [mg/kg]",leg.title.cex=0.7,leg.round=2,leg.wid=4,leg.just="right")

# Text
text(min(X)+diff(range(X))*4/7,max(Y),paste(qutiles*100,collapse=","),cex=0.7)
text(min(X)+diff(range(X))*4/7,max(Y)-diff(range(Y))/25,"Percentiles",cex=0.75)

# scalebar
scalebar(761309,7373050,861309,7363050,shifttext=-0.5,shiftkm=37e3,sizetext=0.8)
# North arrow
Northarrow(362602,7818750,362602,7878750,362602,7838750,Alength=0.15,Aangle=15,Alwd=1.3,Tcex=1.6)



### NEW MAP:
el=(ohorizon[,"Cu"])

# take symbols according to quantiles:
q=13

# symbols and size
symb=c(1,3)
ssize=c(0.4,0.9)

# generate plot with packground
plot(X,Y,frame.plot=FALSE,xaxt="n",yaxt="n",xlab="",ylab="",type="n")
plotbg(map.col=c("gray","gray","gray","gray"),add.plot=T)

# plot symbols:
points(X[el<=q], Y[el<=q], pch=symb[1], cex=ssize[1])
points(X[el>q], Y[el>q], pch=symb[2], cex=ssize[2])

# Legend
legend("topright",pch=rev(symb),pt.cex=rev(ssize), legend=c("> 13","<= 13"),
title="Cu [mg/kg]", cex=0.75)

# scalebar
scalebar(761309,7373050,861309,7363050,shifttext=-0.5,shiftkm=37e3,sizetext=0.8)
# North arrow
Northarrow(362602,7818750,362602,7878750,362602,7838750,Alength=0.15,Aangle=15,Alwd=1.3,Tcex=1.6)


dev.off()