[R] limit to complex plots?
Hanke, Alex
HankeA at mar.dfo-mpo.gc.ca
Thu Feb 26 19:55:18 CET 2004
try:
layout(matrix(c(0,0,0,0,0,1,0,2,0,0,0,0,0,3,0,4), nrow=4,
byrow=TRUE))
plot(rnorm(10), rnorm(10))
plot(rnorm(20), rnorm(20))
plot(rnorm(30), rnorm(30))
plot(rnorm(40), rnorm(40))
> -----Original Message-----
> From: SuzieBlatt at netscape.net [SMTP:SuzieBlatt at netscape.net]
> Sent: Thursday, February 26, 2004 7:15 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] limit to complex plots?
>
>
> Hello all.
>
> I am trying to create one figure, divided into 6 graphs/plots each with an
> inset sub-figure. I can use to layout command to generate one figure with
> one inset sub-figure, but cannot seem to do it for multiple figures on one
> page.
>
> I've tried a test with the following code:
>
> layout(matrix(c(1,2,3,4), nrow=2, byrow=TRUE))
> plot(rnorm(10), rnorm(10))
> plot(rnorm(10), rnorm(10))
> plot(rnorm(30), rnorm(30))
> plot(rnotm(40), rnorm(40))
> layout.show(4)
>
> #this works and gives me my one page with 4 figures on it
>
> layout(matrix(c(0,0,0,0,0,1,0,2,0,0,0,0,0,3,0,4), nrow=4, byrow=TRUE))
> par(new=TRUE)
> plot(rnorm(10), rnorm(10))
>
> par(new=TRUE)
> plot(rnorm(20), rnorm(20))
>
> par(new=TRUE)
> plot(rnorm(30), rnorm(30))
>
> par(new=TRUE)
> plot(rnorm(40), rnorm(40))
>
> # this is the part that doesn't. I've tried only one 'par(new=TRUE)'
> command before ALL the plot commands and as written above. The best I can
> get is 3 sub-figures #2,3 and 4, in positions 1,2 and 3.
>
> Has anyone figured this out?
>
> thanks,
> Suzanne Blatt
>
> __________________________________________________________________
> Introducing the New Netscape Internet Service.
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list