Skip to content
Prev 176091 / 398503 Next

Multiple use of par()

Hi,

Thanks a lot for reminding me of this. The original code is too
complicated and stems from several other objects. So I guess this
simplified code may help:

a <- rnorm(100)
class(a) <- "foo"

plot.foo <- function(data){
##  opar<-par()
  par(mfcol=c(1,2))
  hist(data)
  boxplot(data)
##  par(mfcol=c(1,1))
}

par(mfcol=c(2,2))
plot(a)
plot(a)
plot(a)
plot(a)

I'm hoping to have 2x2 plots of the plot.foo result. But the par()
argument above seem to be overwriting each other. I tried the code
suggested by Erin ( now in commented area). But it doesn't seem to
work, either. Anyone has any suggestions? Thanks a lot,

Best wishes,

On Sat, Apr 4, 2009 at 6:06 AM, Dieter Menne
<dieter.menne at menne-biomed.de> wrote: