Learn R Programming

stRoke (version 23.9.1)

color_plot: Plot color examples with contrasting text

Description

Plots color examples with contrasting text. Parameters are passed to contrast_text.

Usage

color_plot(
  colors,
  labels = TRUE,
  borders = NULL,
  cex_label = 1,
  ncol = NULL,
  ...
)

Value

base plot

Arguments

colors

Vector of colors to plot

labels

Show color names. Default is TRUE

borders

Border parameter for 'rect()' function. Default is NULL

cex_label

Label size. Default is 1.

ncol

Desired number of columns. Default is ceiling of square root to the length of 'colors' vector provided.

...

Parameters for the

Examples

Run this code
par(bg=NULL)
colors <- sample(colors(),size = 20)
color_plot(colors, method="relative")

Run the code above in your browser using DataLab