Re: [S] plot 2+3

Jim Robison-Cox (jimrc@mathfs.math.montana.edu)
Tue, 19 May 1998 10:14:22 -0600 (MDT)


On Tue, 19 May 1998, Christian Hoffmann wrote:

> Hi all,
>
> I want ot plot 2 figures in the first row of a multiple plot, and 3 figures
> in the second. How can I do that?
> Experimenting with
>
> par(mfrow=c(2,2))
> plot( one )
> plot( two )
> par(mfg=c(2,2,2,1))
> par(new=T)
> Plots on new window: which I do not wnat:
> par(mfrow=c(1,3))
> plot( three )
> plot( four )
> plot(five)
>
> Thanks for all answers.
> --Christian
>
>
> Christian W. Hoffmann
> Swiss Federal Institute for Forest, Snow and Landscape Research
> CH-8903 Birmensdorf, Switzerland
> phone: ++41-1-739 22 77 fax : ++41-1-739 22 15 e-mail: hoffmann@wsl.ch
> WWW: http://www.wsl.ch/wsidb/leute/cho/choHPENG.html

Christian,

You need to use the plt plot option with new =T. Here's an example:

x <- matrix(rnorm(120),20,6)
# set proportions of window in horizontal
x2cuts <- c(.05,.45,.55,.95)
x3cuts <- c(.05,.28,.38,.61,.71,.95)
# and proportions of window vertically
y.hi <- c(.55,.98)
y.lo <- c(.08,.45)
# plot 1 in upper left
par(plt=c( x2cuts[1:2],y.hi))
plot(x[,1],x[,2])
# plot 2 in upper right
par(plt=c( x2cuts[3:4],y.hi),new=T)
plot(x[,2],x[,3])
# plot 3 lower left
par(plt=c( x3cuts[1:2],y.lo),new=T)
plot(x[,3],x[,4])
# plot 4 lower middle
par(plt=c( x3cuts[3:4],y.lo),new=T)
plot(x[,4],x[,5])
#plot 5 lower right:
par(plt=c( x3cuts[5:6],y.lo),new=T)
plot(x[,5],x[,6])

Jim Robison-Cox ____________
Department of Math Sciences | | phone: (406)994-5340
2-214 Wilson Hall \ BZN, MT | FAX: (406)994-1789
Montana State University | *_______|
Bozeman, MT 59717 \_| e-mail: jimrc@math.montana.edu

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news