Re: [R] Multiple use of par()

2009-04-04 Thread Dieter Menne
Hesen Peng wrote: > > > 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,

Re: [R] Multiple use of par()

2009-04-04 Thread jim holtman
To get what you want with the basic graphics, you probably want something like this (tuned to you data): 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(4,2)) plot(a) plot(a) plot

Re: [R] Multiple use of par()

2009-04-04 Thread Hesen Peng
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(m

Re: [R] Multiple use of par()

2009-04-04 Thread Dieter Menne
Hesen Peng-2 wrote: > > 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 objec

[R] Multiple use of par()

2009-04-03 Thread Hesen Peng
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(mf