#' Title
#'
#' @param size
#' @param lwd
#' @param xlab.pos
#' @param ylab.pos
#' @param ...
#'
#' @return
#' @export
#'
#' @examples
theme_scalebar<-function(size=12,
lwd=1.5,
xlab.pos=c("bottom", "top"),
ylab.pos=c("left", "right"),...
)
{
xlab.pos=match.arg(xlab.pos)
ylab.pos=match.arg(ylab.pos)
x.vjust=0
y.vjust=2
if(xlab.pos=="top")
x.vjust=3+size/2.5
if(ylab.pos=="right")
y.vjust=-6
theme_bw() +
theme(panel.border=element_blank(),
axis.line=element_line(size=lwd, lineend = "square"),
axis.ticks = element_blank(),
axis.title = element_blank(),
panel.grid = element_blank(),
axis.text.y = element_text(angle = 90, size=size, hjust=0.5, vjust=y.vjust),
axis.text.x = element_text(vjust=x.vjust, size=size),
axis.ticks.length = unit(c(0),"lines")
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.