[R] Graphics: calling par(mar) after frame()

Brahm, David David.Brahm at geodecapital.com
Wed Jul 6 22:20:51 CEST 2005


The following code produces 6 plots on a page, but the first is
distorted and different from the others:

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 implied
by the box.  It seems to be a result of calling par(mar) after frame().
Is this expected behavior, or some kind of bug?

I'm using R-2.1.0 on Linux with X11; I see the same behavior in Windows.

-- David Brahm (brahm at alum.mit.edu)




More information about the R-help mailing list