R/scalebarDisplay.R

Defines functions scalebarDisplay

scalebarDisplay <-
function(scalebar,scalebarSize,scalebarText,txtCexScalebar){
  if(scalebar==TRUE){
    l<-locator(n=1)
    SpatialPolygonsRescale(layout.scale.bar(),offset=c(l$x,l$y),
                           scale=scalebarSize,fill=c("black"),plot.grid=F)
    text(l$x+scalebarSize/2,(l$y),paste(scalebarText,"\n\n",sep=""),cex=txtCexScalebar)
  }
}

Try the rCarto package in your browser

Any scripts or data that you put into this service are public.

rCarto documentation built on May 29, 2017, 9:54 p.m.