[R] axis() color from 1.5.1 to 1.6.1

Martin Maechler maechler at stat.math.ethz.ch
Thu Jan 9 12:16:03 CET 2003

>>>>> "partha" == partha bagchi <partha_bagchi at hgsi.com>
>>>>>     on Tue, 7 Jan 2003 17:02:31 -0500 writes:

    partha> I see that the definition of axis() has changed from
    partha> 1.5.1 to 1.6.1 (as mentioned in the news file for
    partha> 1.6.0). Axis now has a color argument to change it's
    partha> color. However, the following command worked in 1.5.1:

    >> axis(1, at = c(0.1, 0.2, 1, 5, 10), fg= gray(0.7), cex.axis = 0.8, 
    >>      col.axis= "red") #plot the axis in gray with annotations in red.

(yes, "fg" worked, but this was not (explicitly) documented to work.
 I agree though that the "..." vagueness could have lead you to
 use "fg" --- and I think several people including the original
 R authors might have used axis() that way

    partha> The command no longer works in 1.6.1. 

(yes it does work; but differently than in 1.x (x <= 5), and not
 as you'd expected I agree.)

    partha> I am aware that using a col argument in axis would
    partha> work. However, this does break code written
    partha> currently (for 1.5.1) and thus the danger of code
    partha> being specific to the version of R that one is
    partha> using.

    partha> I am interested in knowing why it does not work.

short answer: ``because "col=" now works''.

I see that this is not entirely satisfying for you (and your
older code).  It was really a ``design bug'' that using "fg"
instead of "col" did work (and "col" didn't) in older versions of axis().

However, we could have done the change more back-compatibly,
e.g. still allowing "fg" as `alias' of "col" (when col is not specified)
and give a warning to have users change their code to the new
I'm considering to apply this (R code) patch.

Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><

More information about the R-help mailing list