Hi:

Try this:

pf <- function(p) {
  plot(c(p:(p+10)),c(1:11))
  plot(c(p:(p+10)),c(2:12))
  plot(c(p:(p+10)),c(3:13))
}
par(mfrow = c(3, 3))
for(i in 1:3) pf(i)
par(mfrow = c(1, 1))

HTH,
Dennis

On Wed, Nov 17, 2010 at 8:56 AM, Soyeon Kim <yunni0731@gmail.com> wrote:

> Dear All,
>
> I made a function which gives 3 plots in one window(I used
> par(mfrow=c(1,3)) in the function).
> Using that function 3 times, I want to produce 9 plots in one window.
> I tried par(mfrow=c(3,1)) or par(mfrow=c(3,3)) but it didn't work.
>
> For example,
>
> pf <- function(p) {
>  par(mfrow=c(1,3))
>  plot(c(p:(p+10)),c(1:11))
>  plot(c(p:(p+10)),c(2:12))
>  plot(c(p:(p+10)),c(3:13))
> }
> p <- c(1:3)
>  par(mfrow=c(3,1))
> for(i in 1:3) {
>  pf(p[i])
> }
>
> How can I produce 9 plots or 3*n plots when I use that function n times?
>
> Thank you ahead,
> Soyeon
>
> ______________________________________________
> 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.
>

	[[alternative HTML version deleted]]

