Tuesday, April 23, 2013

Category Colors in R

I thought I'd write down the color palette I use for categories. I've seen many discussions about gradient color choices, but category colors are less often discussed. I have a function given below which generates colors where there is not meant to be an ordering to the color. It is important when data points are near, that they are easy to distinguish with the eye. It makes more sense to see it:


Here's the function:


Here's a comparison of the function (top) and the built-in rainbow function (bottom) which serves the same purpose.



1 comment:

  1. Thank you so much for sharing!!!! I was looking for some palette which I could use with categories in a line plot! This palette is beautiful and useful. Thank you!

    ReplyDelete