previewcolor: Preview color v2.0

View source: R/previewcolor.R

previewcolorR Documentation

Preview color v2.0

Description

Preview one or multiple colors using little rhombi with their little labels up top

Usage

previewcolor(
  x,
  main = NULL,
  bg = "#333333",
  main.col = "#b3b3b3",
  main.x = 0.7,
  main.y = 0.2,
  main.adj = 0,
  main.cex = 0.9,
  main.font = 1,
  width = NULL,
  xlim = NULL,
  ylim = c(0, 2.2),
  asp = 1,
  labels.y = 1.55,
  label.cex = NULL,
  mar = c(0, 0, 0, 1),
  par.reset = TRUE,
  filename = NULL,
  pdf.width = 8,
  pdf.height = 2.5
)

Arguments

x

Color, vector: One or more colors that R understands

main

Character: Title. Default = NULL, which results in deparse(substitute(x))

bg

Background color.

main.col

Color: Title color

main.x

Float: x coordinate for main.

main.y

Float: y coordinate for main.

main.adj

Float: adj argument to mtext for main.

main.cex

Float: character expansion factor for main. Default = .9

main.font

Integer, 1 or 2: Weight of main 1: regular, 2: bold. Default = 2

width

Float: Plot width. Default = NULL, i.e. set automatically

xlim

Vector, length 2: x-axis limits. Default = NULL, i.e. set automatically

ylim

Vector, length 2: y-axis limits.

asp

Float: Plot aspect ratio.

labels.y

Float: y coord for labels. Default = 1.55 (rhombi are fixed and range y .5 - 1.5)

label.cex

Float: Character expansion for labels. Default = NULL, and is calculated automatically based on length of x

mar

Numeric vector, length 4: margin size.

par.reset

Logical: If TRUE, reset par settings on exit.

filename

Character: Path to save plot as PDF.

pdf.width

Numeric: Width of PDF in inches.

pdf.height

Numeric: Height of PDF in inches.

Value

Nothing, prints plot

Examples

colors <- colorgradient.x(seq(-5, 5))
previewcolor(colors)

egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.