SmoothLegend             package:StatDA             R Documentation

_P_l_o_t_s _S_m_o_o_t_h_i_n_g _M_a_p_s _a_n_d _a _L_e_g_e_n_d

_D_e_s_c_r_i_p_t_i_o_n:

     Plots smoothing maps and legend based on continuous or percentile
     scale.

_U_s_a_g_e:

     SmoothLegend(X, Y, z, resol = 200, type = "percentile", whichcol = "gray",
     qutiles = c(0, 0.05, 0.25, 0.5, 0.75, 0.9, 0.95, 1), borders=NULL, leg.xpos.min = 780000,
     leg.xpos.max = 8e+05, leg.ypos.min = 7760000, leg.ypos.max = 7870000,
     leg.title = "mg/kg", leg.title.cex = 0.7, leg.numb.cex = 0.7, leg.round = 2,
     leg.wid = 4, leg.numb.xshift = 70000, leg.perc.xshift = 40000,
     leg.perc.yshift = 20000, tit.xshift = 35000)

_A_r_g_u_m_e_n_t_s:

       X: X-coordinates 

       Y: Y-coordinates 

       z: values on the coordinates 

   resol: resolution of smoothing 

    type: "percentile" for percentile legend; "contin" for continuous
          grey-scale or colour map 

whichcol: type of color scheme to use: "grey", "rainbow",
          "rainbow.trunc", "rainbow.inv", "terrain" or "topo" 

 qutiles: considered quantiles if type="percentile" is used 

 borders: either NULL or character string with the name of the list
          with list elements x and y for x- and y-coordinates of map
          borders 

leg.xpos.min: minimum value of x-position of the legend 

leg.xpos.max: maximum value of x-position of the legend 

leg.ypos.min: minimum value of y-position of the legend 

leg.ypos.max: maximum value of y-position of the legend 

leg.title: title for legend 

leg.title.cex: cex for legend title 

leg.numb.cex: cex for legend numbers 

leg.round: round legend to specified digits "pretty" 

 leg.wid: width (space in numbers) for legend 

leg.numb.xshift: x-shift of numbers in legend relative to leg.xpos.max 

leg.perc.xshift: x-shift of "Percentile" in legend relative to
          leg.xpos.min 

leg.perc.yshift: y-shift of "Percentile" in legend relative to
          leg.ypos.max 

tit.xshift: x-shift of title in legend relative to leg.xpos.max 

_D_e_t_a_i_l_s:

     First a interpolation is applied using different versions of
     algorithms from Akima and then all points a distinguished into
     inside an outside the polygonal region. Now the empirical
     quantiles for points inside the polygon are computed and then the
     values are plotted in different scales of the choosen colour.
     ATTENTION: here borders were defined for the smoothing region

_A_u_t_h_o_r(_s):

     Peter Filzmoser <P.Filzmoser@tuwien.ac.at>

_R_e_f_e_r_e_n_c_e_s:

     C. Reimann, P. Filzmoser, R.G. Garrett, and R. Dutter: Statistical
     Data Analysis Explained. Applied Environmental Statistics with R.
     John Wiley and Sons Inc. To appear.

_E_x_a_m_p_l_e_s:

     data(chorizon)
     X=chorizon[,"XCOO"]
     Y=chorizon[,"YCOO"]
     el=log10(chorizon[,"As"])

     # generate plot 
     plot(X,Y,frame.plot=FALSE,xaxt="n",yaxt="n",xlab="",ylab="",type="n")

     data(bordersKola) # list with list elements x and y for x- and y-corrdinates of map borders
     SmoothLegend(X,Y,el,resol=200,type="contin",whichcol="gray",
         qutiles=c(0,0.05,0.25,0.50,0.75,0.90,0.95,1), borders="bordersKola",
         leg.xpos.min=7.8e5,leg.xpos.max=8.0e5,leg.ypos.min=77.6e5,leg.ypos.max=78.7e5,
         leg.title="mg/kg", leg.title.cex=0.7, leg.numb.cex=0.7, leg.round=2,leg.wid=4,
         leg.numb.xshift=0.7e5,leg.perc.xshift=0.4e5,leg.perc.yshift=0.2e5,tit.xshift=0.35e5)

     # plot background
     data(kola.background)
     plotbg(map.col=c("gray","gray","gray","gray"),map.lwd=c(1,1,1,1),add.plot=TRUE)

