'at' parameter in mtext(.., adj=0, outer=T) (PR#396)

john.maindonald@anu.edu.au john.maindonald@anu.edu.au
Mon, 10 Jan 2000 02:40:37 +0100 (MET)


Depending on the setting of par()$usr, 
the 'at' setting in mtext(.., adj=0, outer=T) may cause the
text to appear in an anomalous position (e. g. in the first
instance below, at the left of the plot region rather than
at 'at=0' in the figure region), or the text may not appear
at all.

If one does not set the 'at' parameter the text appears
(with 'adj=0') on the far left of the plot region.  I assume
this is also anomalous; at all events it is the behaviour
that I wished to circumvent.

The function plot.test() demonstrates the behaviour:

plot.test <-
function(xval=0:4, pos=NULL){
oldpar<-par(oma=c(2,0,0,0))
on.exit(par(oldpar))
plot(xval,xval)
if(is.null(pos))pos<-min(xval)
print(pos)
print(par()$usr)
mtext(side=1,line=3.5,"Marginal text",adj=0,at=pos)
mtext(side=1,line=0.5,"Outer text",outer=T, adj=0,at=min(xval))
}

> plot.test(xval=0:4)  # "Outer text appears on left of the figure region
[1] 0
[1] -0.16  4.16 -0.16  4.16
> plot.test(xval=20:24)  # "Outer text does not appear at all
[1] 20
[1] 19.84 24.16 19.84 24.16
> # Check that at=0 does not work
> plot.test(xval=20:24, pos=0)  # "Outer text does not appear at all
[1] 0
[1] 19.84 24.16 19.84 24.16
>


--please do not edit the information below--

Version:
 platform = Windows
 arch = x86
 os = Win32
 system = x86, Win32
 status = 
 major = 0
 minor = 90.1
 year = 1999
 month = December
 day = 15
 language = R

Windows 9x 4.0 (build 1111)  B

Search Path:
 .GlobalEnv, Autoloads, package:base

John Maindonald               email : john.maindonald@anu.edu.au        
Statistical Consulting Unit,  phone : (6249)3998        
c/o CMA, SMS,                 fax   : (6249)5549  
John Dedman Mathematical Sciences Building
Australian National University
Canberra ACT 0200
Australia


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._