plot.colors: Plot a Vector of Colors so that we can see if they are unique

Description Usage Arguments Examples

Description

Take a vector of colors x and plot them in a way so that each pair of colors occurs once. This allows us to see if they are unique and distinct.

Usage

1
2
## S3 method for class 'colors'
plot(x, ...)

Arguments

x

the colors to plot

...

the parameters passed to pie or plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
library(plotteR)

# set the random seed for reproducibility
set.seed(129855L);

if(!exists("x.range")) x.range <- 4L;
if(!exists("y.range")) y.range <- 5L;

# set the number of diagrams appropriately
old.par <- par(mfrow=c(y.range, x.range), mai=c(0.02, 0.02, 0.02, 0.02));

# paint the diagrams
n <- 1L;
for(y in 1L:y.range) {
  for(x in 1L:x.range) {
    plot.colors(colors.distinct(n));
    n <- n + 1L;
  }
}

# reset the parameters
invisible(par(old.par));

thomasWeise/plotteR documentation built on May 29, 2019, 5:41 a.m.