I wrote: > par(mfrow=c(3,2), las=2) > for (i in 1:6) { > frame() > par(mar=c(7, 7, 1, 1)) > axis(2); box(); abline(h=seq(0,1,.5), col=2:4) > } > The first plot's axes are mis-aligned with the plotting area...
Uwe Ligges <[EMAIL PROTECTED]> replied: > Yes expected, at first you generate the plot, then you change the > margins, and then you add stuff (axis)... > Why do you want to use it inside the loop? Thanks, Uwe, for making it clearer. My toy example puts these commands inside a loop because my real-life problem has them inside a function, which is called inside a loop. My function sets par(mar, usr, mgp). It seems I need to set par(mar) before frame(), par(usr) after frame(), and par(mgp) either before or after. I was not thinking of frame() as "generating the plot" so much as "moving to the next location", so I didn't understand why the order mattered. Thanks again! -- David Brahm ([EMAIL PROTECTED]) ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html