Jie Tang
2012-Jul-10 10:11 UTC
[R] how can I show the xlab and ylab information while using layout
hi R-users: I want to draw three plot into one figure by layout and the script has been shown below. But I find R does not show the xlab and ylab information completely as shown the figure attached. How can I midify the script.? thank you . xxlab<-paste(cpmd," (",ro,"%)",sep=" ") yylab<-paste(rfmd," (",co,"%)",sep=" ") par(mar=c(3,3,1,1)) #layout(matrix(c(2,0,1,3),2,2,byrow=TRUE),widths=lcm(30), heights=lcm(25),TRUE) layout(matrix(c(2,0,1,3),2,2,byrow=TRUE),c(5,1),c(1,5),TRUE) layout.show(3) plot(data_cpmd,data_rfmd,xlab=xxlab,ylab=yylab,xlim=XX,ylim=YY,asp=1) abline(1,1) #rug(side=1,jitter(data_cpmd,5)) #rug(side=2,jitter(data_rfmd,5)) #plot(homo_ana$dism16cpmd,homo_ana$dism16rfmd,main=mtitle,xlab=xxlab,ylab=yylab,xlim=XX,ylim=YY,asp=1) par(mar=c(0,3,1,1)) barplot(data_cpmd, axes=FALSE, ylim=YY, space=0) par(mar=c(3,0,1,1)) barplot(data_rfmd, axes=FALSE,main=mtitle, xlim=XX, space=0, horiz=TRUE) #boxplot(data_cpmd,horizontal = TRUE,xlim=XX,ylim=YY,outline=ifout, xaxt "n") #par(mar=c(3,0,1,1)) #boxplot(data_rfmd,xlim=XX,ylim=YY,outline=ifout,yaxt = "n") -------------- next part -------------- A non-text attachment was scrubbed... Name: homo_jawt_pgtwhr24.png Type: image/png Size: 9100 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20120710/754cabcd/attachment.png>
Sarah Goslee
2012-Jul-10 10:58 UTC
[R] how can I show the xlab and ylab information while using layout
The margins you specified aren't large enough to hold the information you're trying to put in them, so you need to make them larger. Sarah On Tuesday, July 10, 2012, Jie Tang wrote:> hi R-users: > I want to draw three plot into one figure by layout and the script has > been shown below. > But I find R does not show the xlab and ylab information completely as > shown the figure attached. > How can I midify the script.? thank you . > > xxlab<-paste(cpmd," (",ro,"%)",sep=" ") > yylab<-paste(rfmd," (",co,"%)",sep=" ") > par(mar=c(3,3,1,1)) > #layout(matrix(c(2,0,1,3),2,2,byrow=TRUE),widths=lcm(30), > heights=lcm(25),TRUE) > layout(matrix(c(2,0,1,3),2,2,byrow=TRUE),c(5,1),c(1,5),TRUE) > layout.show(3) > plot(data_cpmd,data_rfmd,xlab=xxlab,ylab=yylab,xlim=XX,ylim=YY,asp=1) > abline(1,1) > #rug(side=1,jitter(data_cpmd,5)) > #rug(side=2,jitter(data_rfmd,5)) > > #plot(homo_ana$dism16cpmd,homo_ana$dism16rfmd,main=mtitle,xlab=xxlab,ylab=yylab,xlim=XX,ylim=YY,asp=1) > > par(mar=c(0,3,1,1)) > barplot(data_cpmd, axes=FALSE, ylim=YY, space=0) > par(mar=c(3,0,1,1)) > barplot(data_rfmd, axes=FALSE,main=mtitle, xlim=XX, space=0, horiz=TRUE) > > #boxplot(data_cpmd,horizontal = TRUE,xlim=XX,ylim=YY,outline=ifout, xaxt > "n") > #par(mar=c(3,0,1,1)) > #boxplot(data_rfmd,xlim=XX,ylim=YY,outline=ifout,yaxt = "n") >-- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org [[alternative HTML version deleted]]
Sarah Goslee
2012-Jul-10 12:35 UTC
[R] how can I show the xlab and ylab information while using layout
The mar argument to par(). Please do read ?par and perhaps the posting guide. Sarah On Tuesday, July 10, 2012, Jie Tang wrote:> which parameter ? > > 2012/7/10 Sarah Goslee <sarah.goslee@gmail.com <javascript:_e({}, 'cvml', > 'sarah.goslee@gmail.com');>> > >> The margins you specified aren't large enough to hold the information >> you're trying to put in them, so you need to make them larger. >> >> Sarah >> >> >> On Tuesday, July 10, 2012, Jie Tang wrote: >> >>> hi R-users: >>> I want to draw three plot into one figure by layout and the script has >>> been shown below. >>> But I find R does not show the xlab and ylab information completely >>> as >>> shown the figure attached. >>> How can I midify the script.? thank you . >>> >>> xxlab<-paste(cpmd," (",ro,"%)",sep=" ") >>> yylab<-paste(rfmd," (",co,"%)",sep=" ") >>> par(mar=c(3,3,1,1)) >>> #layout(matrix(c(2,0,1,3),2,2,byrow=TRUE),widths=lcm(30), >>> heights=lcm(25),TRUE) >>> layout(matrix(c(2,0,1,3),2,2,byrow=TRUE),c(5,1),c(1,5),TRUE) >>> layout.show(3) >>> plot(data_cpmd,data_rfmd,xlab=xxlab,ylab=yylab,xlim=XX,ylim=YY,asp=1) >>> abline(1,1) >>> #rug(side=1,jitter(data_cpmd,5)) >>> #rug(side=2,jitter(data_rfmd,5)) >>> >>> #plot(homo_ana$dism16cpmd,homo_ana$dism16rfmd,main=mtitle,xlab=xxlab,ylab=yylab,xlim=XX,ylim=YY,asp=1) >>> >>> par(mar=c(0,3,1,1)) >>> barplot(data_cpmd, axes=FALSE, ylim=YY, space=0) >>> par(mar=c(3,0,1,1)) >>> barplot(data_rfmd, axes=FALSE,main=mtitle, xlim=XX, space=0, horiz=TRUE) >>> >>> #boxplot(data_cpmd,horizontal = TRUE,xlim=XX,ylim=YY,outline=ifout, xaxt >>> >>> "n") >>> #par(mar=c(3,0,1,1)) >>> #boxplot(data_rfmd,xlim=XX,ylim=YY,outline=ifout,yaxt = " >> >>-- Sarah Goslee http://www.stringpage.com http://www.sarahgoslee.com http://www.functionaldiversity.org [[alternative HTML version deleted]]