hey guys I want two plots in one window with an overall title and with individual titles for each plots. my code: par(mfrow=c(2,1)) bp_dirverq1=boxplot(dirverq1, col="orange",horizontal=TRUE, main="Q1 2012",cex.main=0.7) bp_dirverq2=boxplot(dirverq2, col="orange",horizontal=TRUE, main="Q2 2012",cex.main=0.7) title("Direktveranlagung in %",outer=TRUE) Problem: The individual titles are too far away from the plots. Consequently, only the half part of the overall title is within the graph. 1. I need to get the individual titles of closer to the individual graphs. 2. I need to get the overall title to be withing the graphic window. Any suggestions? cheers -- View this message in context: http://r.789695.n4.nabble.com/Adjust-the-position-of-main-in-par-mfrow-tp4637901.html Sent from the R help mailing list archive at Nabble.com.
On Thu, Jul 26, 2012 at 4:28 AM, phillen <phlentner at gmail.com> wrote:> hey guys > > I want two plots in one window with an overall title and with individual > titles for each plots. > > my code: > > par(mfrow=c(2,1)) > bp_dirverq1=boxplot(dirverq1, col="orange",horizontal=TRUE, main="Q1 > 2012",cex.main=0.7) > bp_dirverq2=boxplot(dirverq2, col="orange",horizontal=TRUE, main="Q2 > 2012",cex.main=0.7) > title("Direktveranlagung in %",outer=TRUE) > > Problem: The individual titles are too far away from the plots. > Consequently, only the half part of the overall title is within the graph. > > 1. I need to get the individual titles of closer to the individual graphs. > 2. I need to get the overall title to be withing the graphic window. >It feels hackish but title(....., line = -2) or so usually works for me here.> Any suggestions? > > cheers > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Adjust-the-position-of-main-in-par-mfrow-tp4637901.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.
Try changing your plot and outer margins. par(mfrow=c(2,1), mar=c(4, 4, 2, 1), oma=c(0, 0, 2, 0)) Jean phillen <phlentner@gmail.com> wrote on 07/26/2012 04:28:58 AM:> > hey guys > > I want two plots in one window with an overall title and with individual > titles for each plots. > > my code: > > par(mfrow=c(2,1)) > bp_dirverq1=boxplot(dirverq1, col="orange",horizontal=TRUE, main="Q1 > 2012",cex.main=0.7) > bp_dirverq2=boxplot(dirverq2, col="orange",horizontal=TRUE, main="Q2 > 2012",cex.main=0.7) > title("Direktveranlagung in %",outer=TRUE) > > Problem: The individual titles are too far away from the plots. > Consequently, only the half part of the overall title is within thegraph.> > 1. I need to get the individual titles of closer to the individualgraphs.> 2. I need to get the overall title to be withing the graphic window. > > Any suggestions? > > cheers[[alternative HTML version deleted]]
thanks! the line command worked well. -- View this message in context: http://r.789695.n4.nabble.com/Adjust-the-position-of-main-in-par-mfrow-tp4637901p4637948.html Sent from the R help mailing list archive at Nabble.com.