I would suggest not using pie charts and not trying to make 1000 color distinctions. Also read all of my original post and do some research.
> cols <- hsv(.6, seq(0, 1, length.out=1000), .9) > pie(1:1000, labels="", col=cols, border=NA) David From: carol white [mailto:wht_...@yahoo.com] Sent: Friday, August 8, 2014 9:03 AM To: David L Carlson Subject: Re: [R] color palettes Well I'm using 1000 colors in a pie chart and get the same color but different intensity. I can't fix myself as the number of colors are high. So what would you suggest? Thanks carol On Friday, August 8, 2014 3:58 PM, David L Carlson <dcarl...@tamu.edu<mailto:dcarl...@tamu.edu>> wrote: I think your question is too vague to answer since we don't know what you are trying to do or how many colors you need. The easy answer is that you don't need to use rainbow() at all, just use color names: mycolors <- c("red", "green", "blue", "violet") and you will have one of each. For example, col=mycolors(2) will plot using green (and so will col="green"). There are lots of color names in R: > length(colors(distinct=TRUE)) [1] 502 The longer answer is that there are many color palettes and ways of selecting, manipulating, and choosing colors. The built in functions include palettes such as rainbow, heat.colors, terrain.colors, topo.colors, cm.colors, and gray and ways of specifying colors (in addition to using names) including rgb, hsv, and hcl. In addition, there are several packages for creating color palettes including RColorBrewer, colortools, colorspace, and munsell. ------------------------------------- David L Carlson Department of Anthropology Texas A&M University College Station, TX 77840-4352 -----Original Message----- From: r-help-boun...@r-project.org<mailto:r-help-boun...@r-project.org> [mailto:r-help-boun...@r-project.org<mailto:r-help-boun...@r-project.org>] On Behalf Of carol white Sent: Friday, August 8, 2014 8:27 AM To: r-help@r-project.org<mailto:r-help@r-project.org> Subject: [R] color palettes Hi, Is there any way to take one color of each color family from a color palettes like rainbow? For ex, if there are different blues differentiated by intensity, hue etc, taking one of them. In this case, when using rainbow(n), then how to select 1 color of each family, for ex 1 blue, 1 red etc? It doesn't matter which intensity, hue etc is taken as long as 1 color from each family is taken. Thanks Carol [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org<mailto:R-help@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<http://www.r-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] ______________________________________________ R-help@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.