From maechler at stat.math.ethz.ch  Wed Apr 23 09:00:11 2008
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Wed, 23 Apr 2008 09:00:11 +0200
Subject: [Rd] plot(x) in 2.7.0 (with y=NULL) proposed code correction
In-Reply-To: <Pine.GSO.4.56.0804221309250.8875@devsun3201.insightful.com>
References: <1A68FCB28DE72F4BA3B967E6506CCE4302294889@mildnpexmb01.maninvestments.ad.man.com>
	<18446.6246.920108.375163@stat.math.ethz.ch>
	<Pine.GSO.4.56.0804221309250.8875@devsun3201.insightful.com>
Message-ID: <18446.56955.164407.717723@stat.math.ethz.ch>

Thank you, Bill, (and Gabor BTW) for the nice example.

In the mean time the change has made it into R-patched aka 
'R 2.7.0 patched' , not only in SVN but also already in last night's
snapshot at ftp://stat.ethz.ch/Software/R/

Martin

    BD> On Tue, 22 Apr 2008, Martin Maechler wrote:
    BD> I've committed my proposal, and am interested in feedback,
    BD> notably additional relevant examples.

    BD> I tried the following test and the axes
    BD> looked right in 2.6.2 and the r45453
    BD> (right after your change to plot.R).
    BD> They looked bad (all were 2,4,6,8,10, not
    BD> 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
Martin Maechler