[R] Multiple plots in a single page and stripplot()

From: Lars Karlsson <larsmkarlsson.53_at_gmail.com>
Date: Thu, 17 Jun 2010 09:27:15 +0200


I want to make a 2x2 plot on a single page, using stripplot() and boxplot(). I tried the following two alternatives with mfrow() and layout(), but none of them worked.

library(lattice)
par(mfrow=c(2,2))
boxplot(X1 ~ Y, data=tst1, horizontal=T, las=1) boxplot(X2 ~ Y, data=tst1, horizontal=T, las=1) stripplot(Y ~ X1, data=tst1)
stripplot(Y ~ X2, data=tst1)
par(mfrow=c(1,1))

nf <- layout(matrix(c(1,2,3,4), 2, 2, byrow=TRUE)) layout.show(nf)
boxplot(X1 ~ Y, data=tst1, horizontal=T, las=1) boxplot(X2 ~ Y, data=tst1, horizontal=T, las=1) stripplot(Y ~ X1, data=tst1)
stripplot(Y ~ X2, data=tst1)

What happens is that the two plots with boxplot() appears on one page, and each stripplot() appears on a single page.

If I use stripchart() instead of stripplot() things works as expected (a 2x2 plot on a single page).

What to do to get a 2x2 plot using stripplot()?

Thanks
Lars

        [[alternative HTML version deleted]]



R-help_at_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. Received on Thu 17 Jun 2010 - 08:57:51 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 17 Jun 2010 - 10:00:32 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive