bedtext: Writes the names of the beds in a litholog

View source: R/bedtext.R

bedtextR Documentation

Writes the names of the beds in a litholog

Description

Writes the names of the beds in a litholog. You can either place them at the centre of the beds or in their upper and lower part. You can also define a thickness below which the name won't be written, to avoid excessive text crowding the plot.

Usage

bedtext(
  labels,
  l,
  r,
  x = 0.2,
  arg = list(cex = 1),
  adj = c(0.5, 0.5),
  ymin = NA,
  edge = FALSE
)

Arguments

labels

the name of each bed

l

a vector of n left y (or dt, i.e. depth or time) interval limits for each bed

r

a vector of n right y (or dt, i.e. depth or time) interval limits for each bed

x

the position where to write the text (0.2 by default)

arg

a list of arguments to feed text(). Go see ?text to know which arguments can be provided. See ?merge.list for further information.

adj

one or two values in [0, 1] which specify the x (and optionally y) adjustment of the labels. c(0.5,0.5) is the default.

ymin

minimum thickness of the bed to write its name (if NA, a default value is calculated, but user input is best)

edge

whether to put the bed name at the edge of the beds (T) or in the center of the beds (F, is the default)

See Also

litholog obvisously

if your boundaries have to be recalculated: leftlog

other functions complementing litholog: infobar and ylink

Examples

l  <- c(0,4,5,8)
r  <- c(4,5,8,16)

x   <- c(4,5,3,4)
i <- c("B1","B2","B3","B4")

test <- litholog(l, r, x, i)

whiteSet(xlim = c(0,6), ylim = c(-10,30))

multigons(test$i, test$xy, test$dt, col = c(NA, "black", "grey","NA"))

bedtext(labels = i, r = r, l = l, edge = TRUE, x = 0.5,
        arg = list(col = c("black", "white", "white", "red")))


StratigrapheR documentation built on July 9, 2023, 6:02 p.m.