colorScale: Create a color scale

View source: R/colorScale.R

colorScaleR Documentation

Create a color scale

Description

Simple and flexible color scale.

Usage

colorScale(
  x,
  y,
  col,
  at = NULL,
  labels = NULL,
  horiz = TRUE,
  percx = NULL,
  percy = NULL,
  adj = 0,
  labels.cex = 1,
  title = "legend",
  title.cex = 1.2
)

Arguments

x, y

x and y coordinates of the bottom-left corner of the legend.

col

vector of colors.

at

vector of integers indicating colors to be labeled.

labels

labels.

horiz

a logical. Should the color scale be horizontal?

percx, percy

size of the color scale along the x-axis and the y-axis.

adj

adjust the position labels position. If adj = 0 then labels are at the bottom if horiz = TRUE and on the the left if horiz = FALSE. If adj = 1, labels are at the top if horiz = TRUE and on the the right if horiz = FALSE. So far if horiz = TRUE, title and labels are on opposite sides.

labels.cex

magnification to be used for labels.

title

legend title.

title.cex

magnification to be used for the title.

Examples

plot(c(0, 10), c(0, 10))
colorScale(5, 5, gpuPalette("cisl", 10), at = c(2, 4))


inSileco/graphicsutils documentation built on Sept. 12, 2022, 11:13 p.m.