Re: [R] Multiple lag.plots per page

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Tue 13 Jun 2006 - 17:50:48 EST

On Tue, 13 Jun 2006, Gad Abraham wrote:

> Prof Brian Ripley wrote:
>> On Tue, 13 Jun 2006, Gad Abraham wrote:
>>
>>> Hi,
>>>
>>> I'm trying to plot several lag.plots on a page, however the second plot
>>> replaces the first one (although it only takes up the upper half as it
>>> should):
>>>
>>> par(mfrow=c(2,1))
>>> a<-sin(1:100)
>>> b<-cos(1:100)
>>> lag.plot(a)
>>> lag.plot(b)
>>>
>>> What's the trick to this?
>>
>> lag.plot itself calls par(mfrow). The trick is to get one call to do the
>> plots you want:
>>
>> lag.plot(cbind(a,b))
>>
>>
>
> Thanks, that works great for multiple lag.plots. Is it possible to have a
> lag.plot and another type of plot on the same page? The second plot() always
> replaces the lag.plot for me.

Yes, if the other plot is second, e.g

par(mfrow=c(2,1))
a<-sin(1:100)
lag.plot(a)
par(mfg=c(2,1)) # move to second plot

plot(1:10)

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jun 13 18:18:45 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 14 Jun 2006 - 16:11:48 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.