[R] ?R: Removing white space betwen multiple plots, traditional graphics

Mr Natural drstrong at ucdavis.edu
Sun Jul 22 17:49:25 CEST 2007


Dear List: Thank you for the several helpful comments on my original post of
this title.
Most to the point, 
1. that from z, who is a coauthor of zoo was very kind. I have spent a
morning learning zoo 
and find it a very cool package. With zoo, one can make very neat time
series graphs with
a minimum of code. I had great fun downloading and plotting financial data
from the web.

I still have two problems with zoo for my particular application as per the
original post of this title.
   First, my dates are slightly different for each series. Neither of the
two suggestions for dealing 
different-dates-for-different-series that I have found are appropriate
(na.approx(m), na.locf.(m)).
Is there a way that the NAs can be skipped by each plot, with lines plotted
between the dates that exist,
as in my original code below?
    Second, I have complex standard errors for each point, which are either
read in as a distinct column 
for each y value or calculated in R and plotted with code such as (for the
first two series):

plot(MP~dmp, type="b",xlab="",ylim=c(0,1),xaxt = "n")
arrows(dmp,MP+semp,dmp,MP-semp,length=.02,angle=90,code=3)
plot(C~dc, type="b",xlab="",ylim=c(0,1),xaxt = "n")
arrows(dc,C+sec,dc,C-sec,length=.02,angle=90,code=3)
   I cannot get zoo to do this. 

2. The second helpful comment is from Steven Tucker, and this solves my
problem completely
and elegantly. He suggests changing my parameter statements to:
par(mar=c(0,5,0,2), mfrow = c(6,1), oma=c(5,0,2,0))

Thank you Steven!

Warm regards, Don

ps. This forum is very valuable to the growth of R usage among those of us
who are not programmers.






Mr Natural wrote:
> 
> I would appreciate suggestions for removing the white spaces the graphs in
> a stack:
> 
> par(mar=c(2,2,1,1), mfrow = c(6,1))
> mydates<-dates(1:20,origin=c(month = 1, day = 1, year = 1986))
> plot(rnorm(20,0.1,0.1)~mydates, type="b",xlab="",ylim=c(0,1),xaxt = "n")
> plot(rnorm(20,0.2,0.1)~mydates, type="b",xlab="",ylim=c(0,1),xaxt = "n")
> plot(rnorm(20,0.3,0.1)~mydates, type="b",xlab="",ylim=c(0,1),xaxt = "n")
> plot(rnorm(20,0.5,0.1)~mydates, type="b",xlab="",ylim=c(0,1),xaxt = "n")
> plot(rnorm(20,0.7,0.1)~mydates, type="b",xlab="",ylim=c(0,1),xaxt = "n")
> plot(rnorm(20,0.8,0.1)~mydates, type="b",xlab="",ylim=c(0,1) )
> 
> Thanx, Don
> 

-- 
View this message in context: http://www.nabble.com/-R%3A--Removing-white-space-betwen-multiple-plots%2C-traditional-graphics-tf4119626.html#a11732080
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list