If labels
is numeric, it is used directly as index to the standard color sequence. If 0 is present
among the labels and zeroIsGrey=TRUE
, labels 0 are given grey color.If labels
is not numeric, its columns are turned into factors and the numeric representation of each
factor is used to assign the corresponding colors. In this case commonColorCode
governs whether each
column gets its own color code, or whether the color code will be universal.
The standard sequence start with well-distinguishable colors, and after about 40 turns into a
quasi-random sampling of all colors available in R with the exception of all shades of grey (and gray).
If the input labels
have a dimension attribute, it is copied into the output, meaning the
dimensions of the returned value are the same as those of the input labels
.