[R] ?R: Removing white space betwen multiple plots, traditional graphics
Achim Zeileis
Achim.Zeileis at wu-wien.ac.at
Sat Jul 21 00:20:19 CEST 2007
On Fri, 20 Jul 2007, 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) )
Really, there is no need to do this all by hand. Please have a look at the
"zoo" package (as recommended earlier this week).
Then you can do
x <- cbind(rnorm(20,0.1,0.1),
rnorm(20,0.2,0.1),
rnorm(20,0.3,0.1),
rnorm(20,0.5,0.1),
rnorm(20,0.7,0.1),
rnorm(20,0.8,0.1))
z <- zoo(x, mydates)
plot(z)
plot(z, nc = 1, type = "b")
and much more.
Please consult
vignette("zoo-quickref", package = "zoo")
vignette("zoo", package = "zoo")
as well as the "Date and Time Classes" article by Gabor Grothendieck and
Thomas Petzoldt in R News 4(1), 29-32. (available from your favourite CRAN
mirror).
Z
> Thanx, Don
> --
> View this message in context: http://www.nabble.com/-R%3A--Removing-white-space-betwen-multiple-plots%2C-traditional-graphics-tf4119626.html#a11716176
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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
> and provide commented, minimal, self-contained, reproducible code.
>
>
More information about the R-help
mailing list