[R] How to place a title with layout?

R. Michael Weylandt michael.weylandt at gmail.com
Tue Jul 24 23:34:59 CEST 2012


? title

E.g.,

layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE))
replicate(4, plot(density(rnorm(10)), main = ""))
title("Density Bootstrap", outer = TRUE, line = -2)

though you might have to play with margins to get it just right.

Thanks for the reproducible example!

Michael

On Tue, Jul 24, 2012 at 4:29 PM, Art Burke
<Art.Burke at educationnorthwest.org> wrote:
> Could someone please remind me how to place a title when using layout?
>
> For example, how could I place "This is a demo of layout" as a title for the following, assuming it should go top center?
>
> layout(matrix(c(1,2,3,4), 2, 2, byrow = TRUE))
>
> replicate(4, plot(density(rnorm(10))))
>
> Art
> _______________________________________
> Arthur Burke
> Education Northwest | Senior Methodology Advisor
> 101 SW Main St, Suite 500; Portland OR 97204
> 503.275.9592
> Art.Burke at educationnorthwest.org
> http://educationnorthwest.org
>
> ______________________________________________
> 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