Here is a proposal: At present when you specify a color with an integer it is taken as an index into a fixed table of 8 colors. 1=red, 2=green, 3=blue, 4=cyan, 5=magenta, 6=yellow, 7=white, 8=black [At least this is the intention, there may be bugs in the implementation]. Since I am looking at this anyway (to see if I can see the bug that Martin and Kurt have mentioned) I thought I might make a larger change. I would like to make the color table, user definable. To do this there needs to be a function palette(name, value) where "name" could be used to select one on a number of standard built-in palettes (e.g. "default", "heat", "terrain", "pastels" etc) and (if name was not specified, "value" could be a character vector of color specifications (of length less than or equal to 256?). Either names (e.g. "red", "lightblue" ...) or by rgb values (e.g "#FF00FF") could be used in the vector. The function palette would return the previous palette, and palette() could be used to obtain the current settings without a change. After a call to palette integer col= specification would provide indexes into this table. col=0 could be used to indicate the current background color. The "default" palette would have 1=black. Any comments? Ross =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>>>>> "Ross" == Ross Ihaka <ihaka@stat.auckland.ac.nz> writes:Ross> Here is a proposal: At present when you specify a color with an Ross> integer it is taken as an index into a fixed table of 8 colors. Ross> .... Ross> I would like to make the color table, user definable. To do this Ross> there needs to be a function Ross> palette(name, value) Ross> where "name" could be used to select one on a number of standard Ross> built-in palettes (e.g. "default", "heat", "terrain", "pastels" Ross> etc) and (if name was not specified, "value" could be a character Ross> vector of color specifications (of length less than or equal to Ross> 256?). Either names (e.g. "red", "lightblue" ...) or by rgb Ross> values (e.g "#FF00FF") could be used in the vector. You could even do with one argument -- collapsing name & value. character(1) -> 'name' character(> 1) -> 'value' But this may be just about the S practice which has been in use in functions like diag(..) and seems to confusing people.. Ross> The function palette would return the previous palette, and Ross> palette() could be used to obtain the current settings without a Ross> change. Ross> After a call to palette integer col= specification would provide Ross> indexes into this table. This sounds really great! Just about what I may have dreamed when I sent my e-mail a few weeks ago :-) Ross> col=0 could be used to indicate the current background color. Yes, please Ross> The "default" palette would have 1=black. Ok. Ross> Any comments? Ross Yes: Sounds great! =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-