Hi all,

I created a plot function which used par(mfcol=c(2,1)) so that I could
have two plots together using just one command.

For exampe:

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

Later I wanted to show 4 of these foo objects in the same picture. So
I used par(mfcol=c(2,2)) again at the beginning of the code like:

par(mfcol=c(2,2))
plot(foo.1)
plot(foo.2)
plot(foo.3)
plot(foo.4)

but this time the par() command inside of the functions seem to be
overwriting the par() command at the very begining. Can anyone please
give me some advise on dealing with this? I guess that I may either
need to change the way I plot foo, e.g. using some function rather
than par(), or use some parameters at the beginning. Thank you very
much,

Best wishes,



-- 
彭河森 Hesen Peng
http://hesen.peng.googlepages.com/

______________________________________________
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.

Reply via email to