[Rd] [R] pairs() uses col argument for axes coloring

Duncan Murdoch murdoch at stats.uwo.ca
Fri Jul 8 16:28:02 CEST 2005


On 7/8/2005 8:52 AM, Olaf Mersmann wrote:
> Hi Duncan,
> 
> On 7/8/05, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
>> Olaf Mersmann wrote:
> *snip*
>> > Looking at the source for pairs() suggests, that this is the case
>> > because col is part of the ... argument list which is passed on to
>> > localAxis (and from there to axis). Wouldn't it be more approptiate to
>> > use the same color box() uses to draw the border around each
>> > scatterplot? If yes, should I open a bug for this or how would such a
>> > feature request be handled?
>> 
>> The best way is to get the source to pairs() (from the SVN repository
>> in https://svn.r-project.org/R/trunk/src/library/graphics/R/pairs.R not
>> from looking at it in R), work out what changes are needed, and submit
>> them as a patch.  You can post the patch in the R-bugs list, or just
>> send it to me.   Thanks!
> 
> I attached my patch to pairs.R to fix the problem. They way I 'solved'
> the issue is by simply ignoring any col argument that is passed to
> localAxis and from there to axis. At first I had thought about adding
> col explicitly to the argument list of pairs() and then only passing
> it on to the panel functions, but that would possibly break existing
> code (for example the example panel.cor() in the pairs() man page).

I like your fix.  It makes pairs() act like plot() in its treatment of 
col and col.axis parameters.

I do find the col.axis treatment a little weird (affecting the labels, 
but not the axis), but that's a different issue.

I'll commit your patch to R-devel and R-patched.

Duncan Murdoch



More information about the R-devel mailing list