[R] Adjust the position of main in par(mfrow)

R. Michael Weylandt michael.weylandt at gmail.com
Thu Jul 26 16:35:02 CEST 2012


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.



More information about the R-help mailing list