add.colorbar: Add Colorbar

View source: R/pal.R

add.colorbarR Documentation

Add Colorbar

Description

Add a color bar to any graphical device such as a plot or map. The color bar can be based on any color palette function and be placed either vertically or horizontally.

Usage

add.colorbar(
  min,
  max,
  labels = NULL,
  ticks = NULL,
  labels.at = NULL,
  pal = "greyscale",
  rev = FALSE,
  units = "",
  col.high = "",
  col.low = "",
  log = FALSE,
  base = 10,
  x.pos = NULL,
  width = NULL,
  y.pos = NULL,
  height = NULL,
  cex = 1,
  cex.units = 1,
  n = 255,
  horizontal = FALSE,
  col.lab = "black",
  col.tck = "darkgrey"
)

Arguments

min

The minimum value of the colorbar palette

max

The maximum value of the colorbar palette

labels

The values where labels should be included

ticks

The values where tick marks should be included

pal

The name of a color palette or a color palette function itself

rev

Boolean if the palette color should be reversed

units

A string for the zaxis label

col.high

Color for above range values

col.low

Color for below range values

log

A boolean if the zaxis should be log tranformed

base

The base for the log transformation

x.pos

the position that the x-axis should be centered on (y axis if horizontal)

width

The width of the colorbar

y.pos

the position that the x-axis should be centered on (x axis if horizontal)

height

The length of the colorbar

cex

Size

cex.units

The text size of the units string text

n

The number of colors to be used in the colorbar

horizontal

Whether the colorbar should be placed horizontally rather than vertically

Author(s)

Thomas Bryce Kelly


tbrycekelly/TheSource documentation built on Nov. 7, 2023, 12:48 a.m.