R/print_letter.R

Defines functions print.letter

#' Add text to figure
#' @param label text
#' @param xy location on figure to add text
#' @authorwritten by Chantel Wetzel
print.letter <- function(label="(a)",xy=c(0.1,0.925),...) {   #... means any new parameters are copied faithfully to text() below
  tmp <- par("usr")
  text.x <- tmp[1]+xy[1]*diff(tmp[1:2])   #x position, diff=difference
  text.y <- tmp[3]+xy[2]*diff(tmp[3:4])   #y position
  text(x=text.x, y=text.y, labels=label, ...)             
}
chantelwetzel-noaa/HandyCode documentation built on July 22, 2020, 10:52 a.m.