grcols: Choose n colors using the golden ratio

Description Usage Arguments See Also Examples

View source: R/plot_extra.R

Description

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

Usage

1
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

1
2
3
4
5
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, 2018, 11:02 a.m.