[R] Legend Clipping

Beck, Kenneth (STP)
2008-04-18T15:41:30Z

nf1 <- layout(matrix(1), widths=lcm(6), heights=lcm(6))
nf <- layout(matrix(c(1,2,5,0,3,4),3,2,byrow=TRUE), c(2.2,2.2),
c(2.2,1,2.2), TRUE)
layout.show(nf);
# par(mfrow=c(3,2));

par(font.axis=2);
par(font.lab=2);
# pmn=t(pmn);
tN <- table(Ni <- stats::rpois(100, lambda=5))
barplot(tN, col=rainbow(20))

# par (mfg=c(1,2));
par(font.axis=2);
par(font.lab=2);
tN <- table(Ni <- stats::rpois(100, lambda=5))
barplot(tN, col=rainbow(20))

# par (mfg=c(2,1));
par(font.axis=2);
par(font.lab=2);
tN <- table(Ni <- stats::rpois(100, lambda=5))
barplot(tN, col=rainbow(20))

# par (mfg=c(2,2));
par(font.axis=2);
par(font.lab=2);
tN <- table(Ni <- stats::rpois(100, lambda=5))
barplot(tN, col=rainbow(20))

# par (mfg=c(3,1));
plot(1, type="n", axes=FALSE, xlab="",
ylab="",ylim=c(0,2),xlim=c(0,2));
# legend(1,0.8, legend = c("CPX","Home"), bty="n",
fill=c("blue","red"),lwd=1, cex=1, xjust=0.5, yjust=0.4);
# ltest=legend("center", legend = c("CPX","Home"),
bty="n",
fill=c("blue","red"),lwd=1, cex=1, xjust=0.5,
yjust=0.4,trace=TRUE,plot=FALSE);