Learn R Programming

StratigrapheR (version 1.3.1)

nlegend: New legend element

Description

Prepares a plotting environment for a new element of a multifigure legend

Usage

nlegend(
  t = "Text",
  xt = 1.3,
  xmax = 5,
  xmin = -1.2,
  ymax = 1.5,
  ymin = -ymax,
  asp = NA,
  temp = FALSE,
  ...
)

Arguments

t

text to provide the legend

xt

the x position of the text

xmin, xmax, ymin, ymax

the x and y limits for the plotting area

asp

numeric, giving the aspect ratio y/x, see ‘Details’ of plot.window.

temp

whether to plot a template for visualisation

...

parameters to be fed to the text function, such as cex for the size of the text

See Also

multigons, bedtext, infobar and ylink

Examples

Run this code
opar <- par("mar")

par(mar = c(0,0,0,0))

layout(matrix(1:6, 6, 1, byrow = TRUE))

nlegend(t = paste("Shaded stuff. By the way you can\nwrite",
                  "text in several lines if needed"), cex = 1.2)

rect(-1,-1,1,1, density = 10)

nlegend(t = paste0("Text: left side at x = 1.3 (default xt value)",
                   ";\nsize adapted with cex argument"),
                    temp = TRUE, cex = 1.4)

par(mar = opar)

Run the code above in your browser using DataLab