[6481] in s-news-athena

home help back first fref pref prev next nref lref last post

Re: pairs() bug??

daemon@ATHENA.MIT.EDU (shyu@research.att.com)
Wed Feb 22 11:00:33 1995

From: shyu@research.att.com
Date: Wed, 22 Feb 95 10:14 EST
To: S-news@utstat.toronto.edu


Rich Gonzalez <gonzo@u.washington.edu> wrote :

> The pairs() code suggests that I could pass ylim & xlim arguments to the
> plot command so all the plots have the same ylim and xlim of my choosing.
> I got an error message when I tried that.   That is,
> 
> pairs(x,y,panel=myfunction,ylim=c(0,1), xlim=c(0,1))
> 
> 
> The kludge I worked out was to copy pairs() to pairs.fix(), edit the plot
> to have the specific ylim and xlim I want and it worked fine.  This is not
> a general solution, of course.  Anyone work out a better fix or tell me 
> what I am doing wrong in passing ylim & xlim through pairs?

This is indeed a bug in the current release of S for pairs().
A while ago I posted a fix to this bug :

1. Add the following to pairs() argument list :
	
	xlim = NULL, ylim = NULL

2. Replace the call to .S(plot()) in pairs() by the following :

	.S(plot(if(!is.null(xlim)) xlim else xrange[[j]],
		if(!is.null(ylim)) ylim else xrange[[i]],
		type = "n", axes = F), "plot")

This may very well be the same "kludge" mentioned, but I believe it will
be general enough to solve all the xlim & ylim setting problem in pairs().

Ming

 o=======================================================================o
 | Ming-Jen Shyu (Ming)                 INTERNET:  shyu@research.att.com |
 | AT&T Bell Laboratories, Room 2C-263  UUCP:      attmail!research!shyu |
 | 600 Mountain Avenue                  office:    (908) 582-6863        |
 | Murray Hill, NJ 07974-2070, USA      fax:       (908) 582-3340        |
 o=======================================================================o

home help back first fref pref prev next nref lref last post