I've tried looking at ?colors and ?palette and if I'm understanding it correctly, I'm supposed to type in (for example) palette(rainbow(13)) before I type in my plot (of 13 lines) if I want 13 different colors. But this does not work. Other things that i have tried besides rainbow give me errors. Am I just doing something completely wrong? Anna
On Thu, 23 Oct 2003, Anna Pryor wrote:> I've tried looking at ?colors and ?palette and if I'm understanding it > correctly, I'm supposed to type in (for example) palette(rainbow(13)) before > I type in my plot (of 13 lines) if I want 13 different colors. But this does > not work. Other things that i have tried besides rainbow give me errors. > Am I just doing something completely wrong? >In what sense does it not work? I get thirteen different colors. They aren't very different, but if you want thirteen easily distinguishable colors you will have to choose them yourself rather than relying on rainbow(). -thomas
I believe you want plot(blah blah, col=palette(rainbow(13))) HTH, Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623>>> Anna Pryor <anna at email.arc.nasa.gov> 10/23/03 02:19PM >>>I've tried looking at ?colors and ?palette and if I'm understanding it correctly, I'm supposed to type in (for example) palette(rainbow(13)) before I type in my plot (of 13 lines) if I want 13 different colors. But this does not work. Other things that i have tried besides rainbow give me errors. Am I just doing something completely wrong? Anna ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
On Thu, 23 Oct 2003, James MacDonald wrote:> I believe you want plot(blah blah, col=palette(rainbow(13))) >No. palette() sets the default palette, so eg> palette(rainbow(13)) > plot(1:13,col=1:13)will plot in the new palette. -thomas
Hmmm, I get the same results either way. Regardless of results, is there a reason why my suggestion is 'invalid'? TIA, Jim James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623>>> Thomas Lumley <tlumley at u.washington.edu> 10/23/03 04:26PM >>>On Thu, 23 Oct 2003, James MacDonald wrote:> I believe you want plot(blah blah, col=palette(rainbow(13))) >No. palette() sets the default palette, so eg> palette(rainbow(13)) > plot(1:13,col=1:13)will plot in the new palette. -thomas
On Fri, 24 Oct 2003, James MacDonald wrote:> Hmmm, I get the same results either way. Regardless of results, is there > a reason why my suggestion is 'invalid'? >Well, it does work, but palette() is designed to set or report the current palette, so it makes more sense to do either palette(rainbow(13)) plot(1:13, col=1:13) or plot(1:13, col=rainbow(1:13)) -thomas