Learn R Programming

NCmisc (version 1.1.5)

get.distinct.cols: Return up to 22 distinct colours.

Description

Useful if you want to colour 22 autosomes, etc, because most R colour palettes only provide 12 or fewer colours, or else provide, a gradient which is not distinguishable for discrete categories. Manually curated so the most similar colours aren't side by side.

Usage

get.distinct.cols(n = 22)

Arguments

n

number of unique colours to return

Value

returns vector of n colours

Examples

Run this code
# NOT RUN {
get.distinct.cols(10)
plot(1:22,pch=19,col=get.distinct.cols(22))
# }

Run the code above in your browser using DataLab