Learn R Programming

NCmisc (version 1.2.0)

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)

Value

returns vector of n colours

Arguments

n

number of unique colours to return

Author

Nicholas Cooper njcooper@gmx.co.uk

Examples

Run this code
get.distinct.cols(10)
plot(1:22,pch=19,col=get.distinct.cols(22))

Run the code above in your browser using DataLab