R-alpha: R color problem (col=0 is wrong; col=1 S incompatible)

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Wed, 6 Aug 1997 15:54:56 +0200


>>>>> "Kurt" == Kurt Hornik <hornik@ci.tuwien.ac.at> writes:

    Kurt> There seems to be a small problem with the S-compatible small
    Kurt> numbers color specification, colors 0 and 2 are the same.

    Kurt> Have a look at e.g.  barplot(rbind(1:3, 1), col = c(0,2))

I had reported this problem  even more extensively in R-help (not R-devel),
since I thought it important to be known by everyone:

Here is the relevant part (in R-help, I went further with a wish...):

MM> Date: Mon, 14 Jul 1997 15:07:19 +0200
MM> From: Martin Maechler <maechler@stat.math.ethz.ch>
MM> To: R-help@stat.math.ethz.ch
MM> Subject: R-beta: Plotting: numeric 'col' colors;  col=0, col=1, ..

MM> ``We all know''
MM>  that R has more flexible and nicer color specifications than S-plus.

MM> There are situations however, where I'd like to specify colors numerically,
MM> e.g.
MM> 	1) convenience of using different colors in a for(.) loop
MM>  or
MM> 	2) backward compatibility with S.
MM> 
MM> In S, there's the quite known  ``standard''
MM> 
MM> 	col = 0  :<==>   current background color	[ = white by default]
MM> 	col = 1  :<==>   current foreground color, ie. default color. [ = black]
MM> 
MM> In R, this is currently different:
MM> 
MM> col = 0 is the same as  col = 2  
MM> 	which maybe rather an accident than anything else.
MM> col = 1 however takes a different color than the current foreground
MM> 	-- which can be NICE  in certain situations, where we'd rather have
MM> 	   points / lines  in a different color than the default foreground
MM> 	On the other hand, I think  "S compatibility" is more important here.
MM> 
MM> I assume that it's not too hard to change the 
MM> ``numeric color'' map such as to get S compatibility.

Yes, I still think it would be nice if this was changed...

- Martin
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-