Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com
# In a layout with exactly two rows and columns the base value of ‘"cex"’ is
reduced by a factor of 0.83: if
# there are three or more of either rows or columns, the reduction factor is
0.66.
FINDCEX <- function()
{
CORRECT <- 1
MFROW <- par()$mfrow
MFCOL <- par()$mfcol
TEST <- all(MFROW == MFCOL)
if (TEST && MFROW == c(2,2)) CORRECT <- 1 /
0.83
if (TEST && (MFROW[1] >= 3 | MFROW[2] >= 3)) CORRECT <- 1 / 0.66
if (!TEST) cat("MFROW does not equal MFCOL\n")
cat(MFROW, CORRECT, "\n")
return(CORRECT)
}
pdf("TestCEX.pdf", 8, 6)
par(mfrow=c(1,1), omi=c(1,1,1,1))
plot(1)
mtext(outer=T, side=1, line=0, cex=1, "line 0")
mtext(outer=T, side=1, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=3, line=0, cex=1, "line 0")
mtext(outer=T, side=3, line=1, cex=1, "line 1")
mtext(outer=T, side=2, line=0, cex=1, "line 0")
mtext(outer=T, side=2, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=4, line=0, cex=1, "line 0")
mtext(outer=T, side=4, line=1, cex=1, "line 1")
par(mfrow=c(1,2), omi=c(1,1,1,1))
plot(1)
mtext(outer=T, side=1, line=0, cex=1, "line 0")
mtext(outer=T, side=1, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=3, line=0, cex=1, "line 0")
mtext(outer=T, side=3, line=1, cex=1, "line 1")
mtext(outer=T, side=2, line=0, cex=1, "line 0")
mtext(outer=T, side=2, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=4, line=0, cex=1, "line 0")
mtext(outer=T, side=4, line=1, cex=1, "line 1")
par(mfrow=c(2,2), omi=c(1,1,1,1))
plot(1)
mtext(outer=T, side=1, line=0, cex=1, "line 0")
mtext(outer=T, side=1, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=3, line=0, cex=1, "line 0")
mtext(outer=T, side=3, line=1, cex=1, "line 1")
mtext(outer=T, side=2, line=0, cex=1, "line 0")
mtext(outer=T, side=2, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=4, line=0, cex=1, "line 0")
mtext(outer=T, side=4, line=1, cex=1, "line 1")
par(mfrow=c(3,3), omi=c(1,1,1,1))
plot(1)
mtext(outer=T, side=1, line=0, cex=1, "line 0")
mtext(outer=T, side=1, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=3, line=0, cex=1, "line 0")
mtext(outer=T, side=3, line=1, cex=1, "line 1")
mtext(outer=T, side=2, line=0, cex=1, "line 0")
mtext(outer=T, side=2, line=FINDCEX(), cex=1, "line FINDCEX")
mtext(outer=T, side=4, line=0, cex=1, "line 0")
mtext(outer=T, side=4, line=1, cex=1, "line 1")
graphics.off()
system("open TestCEX.pdf")
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.