plotColor: Plot Color

View source: R/plotColor.R

plotColorR Documentation

Plot Color

Description

Plot vector of colors and their labels in order to preview them for later use

Usage

plotColor(color_v, title_v = NULL, save_v = F, pch_v = 15, cex_v = 3)

Arguments

color_v

- character vector of color names, hex codes, etc. to be plotted. If named, the names will be plotted as well.

title_v

- optional title for plot. Default is NULL

save_v

- logical. F - print to console without saving; T - save file to working directory. File name will be title_v with spaces changed to underscore. If title_v is NULL, title is 'colors.pdf'

pch_v

- standard graphical parameter controlling point type. Default is 15 (square). see ?pch for list of options

cex_v

- standard graphical parameter controlling point size. Default is 3.

Value

print plot to stdout or to file

Examples

col1 <- c("red", "blue", "black", "green"); names(col1) <- col1
col2 <- c("#1B9E77", "#D95F02", "#7570B3", "#E7298A", "#66A61E", "#E6AB02", "#A6761D", "#666666")
plotColor(col1, title_v = "Named Colors")
plotColor(col2, title_v = "Hex Colors")

weshorton/wrh.rUtils documentation built on Oct. 28, 2024, 7:24 a.m.