From bill at insightful.com  Tue Apr 22 22:15:17 2008
From: bill at insightful.com (Bill Dunlap)
Date: Tue, 22 Apr 2008 13:15:17 -0700 (PDT)
Subject: [Rd] plot(x) in 2.7.0 (with y=NULL) proposed code correction
In-Reply-To: <18446.6246.920108.375163@stat.math.ethz.ch>
References: <1A68FCB28DE72F4BA3B967E6506CCE4302294889@mildnpexmb01.maninvestments.ad.man.com>
	<18446.6246.920108.375163@stat.math.ethz.ch>
Message-ID: <Pine.GSO.4.56.0804221309250.8875@devsun3201.insightful.com>

On Tue, 22 Apr 2008, Martin Maechler wrote:

> I've committed my proposal, and am interested in feedback,
> notably additional relevant examples.

I tried the following test and the axes
looked right in 2.6.2 and the r45453
(right after your change to plot.R).
They looked bad (all were 2,4,6,8,10, not
1*pi,2*pi,3*pi) in r45390 (2008-04-19).


Axis.MyRadian <- function(x = NULL, at = NULL, ...,
    side, labels = NULL)
{
    r <- range(x)
    npi <- floor(r[1]/pi):ceiling(r[2]/pi)
    at <- npi * pi
    labels <- as.expression(lapply(
        npi,function(i)substitute(i*pi, list(i=i))))
    axis(side=side, at=at, labels=labels)
}
par(mfrow=c(2,2))
plot(structure(1:10, class="MyRadian"), sin(1:10),
   main="n pi radians on x  axis")
plot(structure(1:10, class="MyRadian"),
   main="n pi radians on y axis")
plot(structure(1:10, class="MyRadian"),
   structure(10:1, class="MyRadian"),
   main="n pi radians on both axes")
plot(1:10, 1:10, main="no pi's on either axis")
par(mfrow=c(2,2))


----------------------------------------------------------------------------
Bill Dunlap
Insightful Corporation
bill at insightful dot com
360-428-8146

 "All statements in this message represent the opinions of the author and do
 not necessarily reflect Insightful Corporation policy or position."



[Rd] plot(x) in 2.7.0 (with y=NULL) proposed code correction
Bill Dunlap