Dear members, I want to create 8 graphs and write it into one page using mfrow=c(4,2). How to make all graphs (including the titles, legends, line types) to be scale down (resized proportionally). As an illustration, below is the code: pdf("testmfrow.pdf") par(mfrow=c(4,2)) x<-seq(1:10) y1<-rnorm(10) y2<-rnorm(10,mean=2,sd=1) y3<-rnorm(10,mean=3,sd=1) y4<-rnorm(10,mean=4,sd=1) y5<-rnorm(10,mean=5,sd=1) y6<-rnorm(10,mean=6,sd=1) y7<-rnorm(10,mean=7,sd=1) y8<-rnorm(10,mean=8,sd=1) plot(x,y1,type='o', lty=1, main="I want this title is to be scaled down (resized)") plot(x,y2,type='o', lty=2, main="I want this title is to be scaled down (resized)") plot(x,y3,type='o', lty=3, main="I want this title is to be scaled down (resized)") plot(x,y4,type='o', lty=4, main="I want this title is to be scaled down (resized)") plot(x,y5,type='o', lty=5, main="I want this title is to be scaled down (resized)") plot(x,y6,type='o', lty=6, main="I want this title is to be scaled down (resized)") plot(x,y7,type='o', lty=7, main="I want this title is to be scaled down (resized)") plot(x,y8,type='o', lty=8, main="I want this title is to be scaled down (resized)") dev.off() Many thanks for any help/idea. Gusanto [[alternative HTML version deleted]]
Hi Gusanto, "cex" (for character expansion) arguments can do some of what you want. See if the cex arguments in the first three plots do what you want. See help for plot.default> ?plot.defaultand ?par for some discussion of cex arguments. pdf("testmfrow.pdf") par(mfrow=c(4,2)) x<-seq(1:10) y1<-rnorm(10) y2<-rnorm(10,mean=2,sd=1) y3<-rnorm(10,mean=3,sd=1) y4<-rnorm(10,mean=4,sd=1) y5<-rnorm(10,mean=5,sd=1) y6<-rnorm(10,mean=6,sd=1) y7<-rnorm(10,mean=7,sd=1) y8<-rnorm(10,mean=8,sd=1) plot(x,y1,type='o', lty=1, main="I want this title is to be scaled down (resized)", cex.main = 0.3) plot(x,y2,type='o', lty=2, main="I want this title is to be scaled down (resized)", cex = 0.1) plot(x,y3,type='o', lty=3, main="I want this title is to be scaled down (resized)", cex.axis = 0.1) plot(x,y4,type='o', lty=4, main="I want this title is to be scaled down (resized)") plot(x,y5,type='o', lty=5, main="I want this title is to be scaled down (resized)") plot(x,y6,type='o', lty=6, main="I want this title is to be scaled down (resized)") plot(x,y7,type='o', lty=7, main="I want this title is to be scaled down (resized)") plot(x,y8,type='o', lty=8, main="I want this title is to be scaled down (resized)") dev.off() Best Steven McKinney -----Original Message----- From: r-help-bounces at r-project.org on behalf of Agus Susanto Sent: Tue 5/13/2008 5:20 PM To: R-help at r-project.org Subject: [R] mfrow Dear members, I want to create 8 graphs and write it into one page using mfrow=c(4,2). How to make all graphs (including the titles, legends, line types) to be scale down (resized proportionally). As an illustration, below is the code: pdf("testmfrow.pdf") par(mfrow=c(4,2)) x<-seq(1:10) y1<-rnorm(10) y2<-rnorm(10,mean=2,sd=1) y3<-rnorm(10,mean=3,sd=1) y4<-rnorm(10,mean=4,sd=1) y5<-rnorm(10,mean=5,sd=1) y6<-rnorm(10,mean=6,sd=1) y7<-rnorm(10,mean=7,sd=1) y8<-rnorm(10,mean=8,sd=1) plot(x,y1,type='o', lty=1, main="I want this title is to be scaled down (resized)") plot(x,y2,type='o', lty=2, main="I want this title is to be scaled down (resized)") plot(x,y3,type='o', lty=3, main="I want this title is to be scaled down (resized)") plot(x,y4,type='o', lty=4, main="I want this title is to be scaled down (resized)") plot(x,y5,type='o', lty=5, main="I want this title is to be scaled down (resized)") plot(x,y6,type='o', lty=6, main="I want this title is to be scaled down (resized)") plot(x,y7,type='o', lty=7, main="I want this title is to be scaled down (resized)") plot(x,y8,type='o', lty=8, main="I want this title is to be scaled down (resized)") dev.off() Many thanks for any help/idea. Gusanto [[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.
Which flavor do you want: pdf("testmfrow.pdf") par(mfrow=c(4,2)) x<-seq(1:10) y1<-rnorm(10) y2<-rnorm(10,mean=2,sd=1) y3<-rnorm(10,mean=3,sd=1) y4<-rnorm(10,mean=4,sd=1) y5<-rnorm(10,mean=5,sd=1) y6<-rnorm(10,mean=6,sd=1) y7<-rnorm(10,mean=7,sd=1) y8<-rnorm(10,mean=8,sd=1) plot(x,y1,type='o', lty=1, main="I want this title is to be scaled down (resized)", cex.main=.5, cex.axis=.5, cex.lab=.5) plot(x,y2,type='o', lty=2, main="I want this title is to be scaled down (resized)", cex.main=.75) plot(x,y3,type='o', lty=3, main="I want this title is to be scaled down (resized)", cex.main=.85) plot(x,y4,type='o', lty=4, main="I want this title is to be scaled down (resized)", cex.lab=.5, cex.main=.75) plot(x,y5,type='o', lty=5, main="I want this title is to be scaled down (resized)",cex=.75) plot(x,y6,type='o', lty=6, main="I want this title is to be scaled down (resized)") plot(x,y7,type='o', lty=7, main="I want this title is to be scaled down (resized)") plot(x,y8,type='o', lty=8, main="I want this title is to be scaled down (resized)") dev.off() On Tue, May 13, 2008 at 8:20 PM, Agus Susanto <gusanto@gmail.com> wrote:> Dear members, > I want to create 8 graphs and write it into one page using mfrow=c(4,2). > How to make all graphs (including the titles, legends, line types) to be > scale down (resized proportionally). > As an illustration, below is the code: > > pdf("testmfrow.pdf") > par(mfrow=c(4,2)) > > x<-seq(1:10) > y1<-rnorm(10) > y2<-rnorm(10,mean=2,sd=1) > y3<-rnorm(10,mean=3,sd=1) > y4<-rnorm(10,mean=4,sd=1) > y5<-rnorm(10,mean=5,sd=1) > y6<-rnorm(10,mean=6,sd=1) > y7<-rnorm(10,mean=7,sd=1) > y8<-rnorm(10,mean=8,sd=1) > > plot(x,y1,type='o', lty=1, main="I want this title is to be scaled down > (resized)") > plot(x,y2,type='o', lty=2, main="I want this title is to be scaled down > (resized)") > plot(x,y3,type='o', lty=3, main="I want this title is to be scaled down > (resized)") > plot(x,y4,type='o', lty=4, main="I want this title is to be scaled down > (resized)") > plot(x,y5,type='o', lty=5, main="I want this title is to be scaled down > (resized)") > plot(x,y6,type='o', lty=6, main="I want this title is to be scaled down > (resized)") > plot(x,y7,type='o', lty=7, main="I want this title is to be scaled down > (resized)") > plot(x,y8,type='o', lty=8, main="I want this title is to be scaled down > (resized)") > > dev.off() > > > Many thanks for any help/idea. > > Gusanto > > [[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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >-- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? [[alternative HTML version deleted]]
Apparently Analagous Threads
- [R-pkgs] New package: `lavaan' for latent variable analysis (including structural equation modeling)
- Importing data in text file into R
- who happenly read these two paper Mohsen Pourahmadi (biometrika1999, 2000)
- {R} How to extract correctly from vector?
- Manipulation of data.frame into an array