[R] Is this a bug? Having cex!=1 before setting par(mai=) gives strange line spacings.
Jens Oehlschlägel
joehl at web.de
Fri Dec 29 11:04:56 CET 2000
width <- 7
height <- 5
# create whatever device type
# and have cex=1 before setting par(mai=)
windows(width=width, height=height, rescale="R")
oldmai <- par("mai")
par(cex=1)
par(mai=oldmai)
plot.new()
par(usr=c(0,2,0,2))
par(cex=2)
par1 <- par()
text(1,1,"there is hardly anything i know for sure\nneither of the future nor of the past\nnor should i know what to ask\nif the person answering was you\n\n(Ernst Jandl, stanzen)")
dev.off()
# now set cex != 1 before setting par(mai=)
# shouldn't change anything but does change line spacing
windows(width=width, height=height, rescale="R")
par(cex=2)
par(mai=oldmai)
plot.new()
par(usr=c(0,2,0,2))
par(cex=2)
par1 <- par()
text(1,1,"there is hardly anything i know for sure\nneither of the future nor of the past\nnor should i know what to ask\nif the person answering was you\n\n(Ernst Jandl, stanzen)")
dev.off()
> windows(width=width, height=height, rescale="R")
>
> ## changing par(cex=) alone does NOT change par("csi")
> par(cex=1)
> par1 <- par()
> par(cex=2)
> par2 <- par()
> all.equal(par1, par2)
[1] "Component cex: Mean relative difference: 1"
> par1$cex
[1] 1
> par2$cex
[1] 2
>
> ## changing par(cex=) and par(mai=) DOES change par("csi")
> par(cex=1)
> par(mai=oldmai)
> par1 <- par()
> par(cex=2)
> par(mai=oldmai)
> par2 <- par()
> all.equal(par1, par2)
[1] "Component cex: Mean relative difference: 1"
[2] "Component csi: Mean relative difference: 1"
[3] "Component mar: Mean relative difference: 0.5"
> par1$cex
[1] 1
> par2$cex
[1] 2
> par1$csi
[1] 0.1875
> par2$csi
[1] 0.375
> par1$mar
[1] 5.1 4.1 4.1 2.1
> par2$mar
[1] 2.55 2.05 2.05 1.05
Regards
Jens Oehlschlaegel
(Research Consultant)
--please do not edit the information below--
Version:
platform = i386-pc-mingw32
arch = x86
os = Win32
system = x86, Win32
status =
major = 1
minor = 2.0
year = 2000
month = 12
day = 15
language = R
Windows NT 4.0 (build 1381) Service Pack 6
Search Path:
.GlobalEnv, package:ctest, Autoloads, package:base
_______________________________________________________________________________
Alles unter einem Dach: Informationen, Fun, E-Mails. Bei WEB.DE: http://web.de
Die große Welt der Kommunikation: E-Mail, Fax, SMS, WAP: http://freemail.web.de
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list