Skip to content

Instantly share code, notes, and snippets.

View BastienNguyen's full-sized avatar

Bastien Nguyen BastienNguyen

View GitHub Profile
@Pakillo
Pakillo / fig_label.R
Created April 10, 2017 17:03
R function to draw figure labels in base plots
## from: https://logfc.wordpress.com/2017/03/15/adding-figure-labels-a-b-c-in-the-top-left-corner-of-the-plotting-region/
fig_label <- function(text, region="figure", pos="topleft", cex=NULL, ...) {
region <- match.arg(region, c("figure", "plot", "device"))
pos <- match.arg(pos, c("topleft", "top", "topright",
"left", "center", "right",
"bottomleft", "bottom", "bottomright"))
if(region %in% c("figure", "device")) {