[R] plotting many unique colors with categorical data
jim holtman
jholtman at gmail.com
Fri Aug 5 21:40:38 CEST 2011
If you go to color brewer (http://colorbrewer2.org/) they don't have
any color sequences above about 12 to provide separation. 75 is
probably way too many, especially considering that a portion of the
population is color blind and other can not see some of the
gradations. You can create a pallet with 100 gradations so you can
get an idea of what the spread is, but don't try to determine what an
exact value is from the colors.
You might try out Edward Tufte's site
(http://www.edwardtufte.com/tufte/) to get an idea on how to visualize
data.
On Fri, Aug 5, 2011 at 1:46 PM, SavageMaDaMe <rloiselle at usgs.gov> wrote:
> Hi- I am trying to plot a matrix of categorical values across time using
> color to represent each individual factor. For example:
>
> 1982 1983 1984 1985 1986 1987
> 1 19 19 68 68 19 19 68
> 2 68 68 19 19 68 68 19
> 3 26 26 34 34 26 26 26
> 4 57 34 57 57 34 57 34
> 5 34 57 26 26 57 34 57
> 6 28 28 28 28 28 58 58
> 7 60 10 58 58 58 28 28
> 8 58 58 42 27 10 39 39
> 9 22 39 22 42 42 27 42
> 10 39 22 10 39 39 20 10
>
>
> I have 75 factors which could be in different positions through out time
> (26 years). I've successfully created a plot using both ggplot() and
> color2D.matplot(), but can not select enough distinct colors from the
> default color palettes available to be able to view differences in the data.
> I've tried messing with RGB values, Brewer palettes, etc.
>
> How can I select colors from a list of available colors without choosing
> ones which are too close in similarity to each other. For instance, I could
> have several very similar blues, but if the Hue or saturation was different
> on each, it would be fairly easy to tell the difference?
>
> Maybe there are too many factors to make this visual representation
> effective?
>
> Thanks in advance for your help!
>
> --
> View this message in context: http://r.789695.n4.nabble.com/plotting-many-unique-colors-with-categorical-data-tp3721807p3721807.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Jim Holtman
Data Munger Guru
What is the problem that you are trying to solve?
More information about the R-help
mailing list