grcols: Choose n colors using the golden ratio

View source: R/plot_extra.R

grcolsR Documentation

Choose n colors using the golden ratio

Description

This chooses n colour hues using a sequence generated by the Golden Ratio.

Usage

grcols(n, s = 0.5, v = 1, alpha = 1)

Arguments

n

number of colors

s, v

numeric vectors of values in the range [0, 1] for "saturation" and "value," respectively, to be combined to form a vector of colors; values in shorter arguments are recycled

alpha

numeric vector of values in the range [0, 1] for alpha transparency channel (0 is transparent and 1 is opaque)

See Also

hsv

Examples

plot(1:5, 1:5, col = grcols(5), pch = 20, cex = 3)

plot(c(1, 6), c(0, 1), type = 'n', axes = FALSE, 
     bty = 'n', xlab = '', ylab = '')
rect(1:5, 0, 2:6, 1, col = grcols(5), border = NA)


raredd/plotr documentation built on Nov. 19, 2023, 4:09 a.m.