SpectrumLegend: Produce a legend for continuous gradient scales

View source: R/helper_functions.R

SpectrumLegendR Documentation

Produce a legend for continuous gradient scales

Description

Prints an annotated vertical bar coloured according to a continuous palette.

Usage

SpectrumLegend(
  x0 = 0.05,
  y0 = 0.05,
  x1 = x0,
  y1 = y0 + 0.2,
  absolute = FALSE,
  legend = character(0),
  palette,
  lwd = 4,
  lty = 1,
  lend = "square",
  cex = 1,
  text.col = par("col"),
  font = NULL,
  text.font = font,
  title = NULL,
  title.col = text.col[1],
  title.cex = cex[1],
  title.adj = 0.5,
  title.font = 2,
  pos = 4,
  ...
)

Arguments

x0, y0, x1, y1

Coordinates of the bottom-left and top-right end of the bar.

absolute

Logical specifying whether x and y values denote coordinates (TRUE) or relative position, where (0, 0) denotes the bottom-left of the plot area and (1, 1) the top right.

legend

Character vector with which to label points on palette.

palette

Colour palette to depict.

lwd, lty, lend

Additional parameters to segments(), controlling line style.

cex

Character expansion factor relative to current par("cex").

text.col

Colour used for the legend text.

font, text.font

Font used for the legend text; see text().

title

Text to display

title.col

Colour for title; defaults to text.col[1].

title.cex

Expansion factor(s) for the title, defaults to cex[1].

title.adj

Horizontal adjustment for title: see the help for par("adj").

title.font

Font used for the legend title.

pos, ...

Additional parameters to text().

Details

This function is now deprecated; it has been superseded by the more capable PlotTools::SpectrumLegend() and will be removed in a future release.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)


TreeTools documentation built on Sept. 11, 2024, 8:27 p.m.