Learn R Programming

StratigrapheR (version 1.3.1)

infobar: Draws rectangles with text in them

Description

Draws rectangles with text in them, typically to delimit (stratigraphical) intervals (e.g. magnotochrons, but also lithostratigraphy,...)

Usage

infobar(
  xmin,
  xmax,
  ymax,
  ymin,
  labels = NA,
  m = list(),
  t = list(),
  srt = 90,
  family = par("family"),
  xpd = par("xpd")
)

Arguments

xmin, xmax, ymin, ymax

x and y limits for the rectangles. You can either provide 1 or n of each (if you want to have always the same x limits but multiple and different y ones it is possible)

labels

a 1 or n character vector (i.e. text) specifying the text to be written in the rectangle. You can write "" for no text.

m, t

a list graphical parameters (of length 1 or n) to feed multigons() for m and to text() for t. See respective help pages ?multigons and ?text for the possible arguments. See the example for illustration, and ?merge_list for further information.

srt, family, xpd

further graphical parameters, see ?par for information

See Also

Similar functions: multigons, bedtext, nlegend and ylink

To deal with intervals: as.lim and related functions

Examples

Run this code
labels <- c("High 5", "Low 5", "5")
ymin <- c(10,-10,2.5)
ymax <- c(20,0, 7.5)

plot(c(0,6),c(-20,20), type = "n")

infobar(xmin = 0, xmax = 1, ymin = ymin, ymax = ymax, labels,
        m = list(col = c("grey","grey", "red"),
                 border = "black", density = 10),
        t = list(cex = 1.5, col = "white"))

Run the code above in your browser using DataLab