par(mfrow=c(1,1)) will give you just one panel. Try par(mfrow=c(2,1)) or par(mfrow=c(1,2)).
-----Original Message-----
From: r-help-bounces at r-project.org on behalf of johnhj
Sent: Sun 3/22/2009 10:50 AM
To: r-help at r-project.org
Subject: [R] Problems with combining plots
Hii,
I will combine some plots. Like this example here
http://www.statmethods.net/advgraphs/layout.html I tired to do it for 2
plots but without success.
Here is my code:
test<-read.table(file="D:/file.txt")
space<-read.table(file="D:/space.txt")
space$gruppe <- 502*rep(1:6, each=7)
x<- c(test$V1)
y<- c(test$V2)
par(mfrow=c(1,1))
png(filename = "D:/example.png", width = 640, height = 480, pointsize = 12,
bg = "white", res = NA)
boxplot(V2 ~ gruppe , data = space , col = "lightgray",boxwex=0.2)
plot(panel.first=grid(ny=NULL,nx=NULL),x,y, xlab = "Zeit(sec)", ylab
="Datenrate(MBit(sec))",ylim=c(0,40), col ="purple", type ="l", main
="combined plots",lwd=2)
dev.off()
What is the mistake in my code ?