When you call xyplot in a for loop you have to use the print command. For instance modifying the xyplot example:
The following wont work: Depth <- equal.count(quakes$depth, number=8, overlap=.1) for(i in 1:3){xyplot(lat ~ long | Depth, data = quakes)} But this will: for(i in 1:3){print(xyplot(lat ~ long | Depth, data = quakes))} Regards Wayne -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Samor Gandhi Sent: 01 October 2007 15:20 To: [EMAIL PROTECTED] Subject: [R] xyplot Hello, I am calling the following code with the loop! It makes 3 out graphs but empty! COuld you help me plase on that? Thank you in advance z1 <- dbConnect(MyData, "something", "A1", "A2") for (tt in c("xyz", "abc", "m1")) { message(paste("Here", tt, "!!!")) mydata <- dbReadTable(z1, tt) jpeg(file=paste("D:/", tt, ".jpg", sep=""), width=00, height=100) plot.method="bitmap" xyplot(MyVALUE ~ MyNo | as.character(ID), data = mydata, main = tt, xlab = " ", ylab = " ", type="l") dev.off() } --------------------------------- [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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. ______________________________________________ R-help@r-project.org 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.