addfiglabel: add an identifier to subpanels in a plot

View source: R/addfiglabel.R

addfiglabelR Documentation

add an identifier to subpanels in a plot

Description

add an identifier to subpanels in a plot

Usage

addfiglabel(lab, xloc = -1, yloc = 1, ...)

Arguments

lab

character, the text to appear (e.g. "(a)")

xloc

numeric, the location of the text along the x-axis (default: -1)

yloc

numeric, the location of the text along the y-axis (default: 1)

...

additional parameters passed on the text() function, e.g. cex, col etc

Details

the function produces a new plot on top of the current one, albeit without axes and annotations (think of a new 'layer'). The text is then written according to the coordinates passed on, which by default places the text label in the top left corner.

Value

a plot

Examples

par(mfcol = c(2, 2))
plot(1:10)
addfiglabel("(a)")
plot(1:10)
addfiglabel("(b)", cex = 0.5, col = "red")
par(mar = c(2,2,2,2))
plot(1:10)
addfiglabel("(c)")
plot(1:10)
addfiglabel("(d)", cex = 3)

gobbios/cfp documentation built on April 11, 2022, 2:22 a.m.