common title for graphs in a (1x2) layout

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

common title for graphs in a (1x2) layout

Rodrigo Tsai
Dear all,

Many thanks for the help suggesting the use of "layout" cmd.

How to insert a title in a 1x2 layout? The title is related to both graphs.
I looked for it in help, unsuccessfully.

Thanks in advance,
Rodrigo.

my reproductible code:
----------------------------------------------------------------------

def.par <- par(no.readonly = TRUE)

nf <- layout(matrix(c(1,2), 1,2,byrow=T), c(1,1), c(1,1), T)

layout.show(nf)



plot(rnorm(10,0,1))

plot(rnorm(10,0,0.1))

par(def.par)

----------------------------------------------------------------------

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: common title for graphs in a (1x2) layout

Mike Prager
Something like this?

def.par <- par(no.readonly = TRUE)
nf <- layout(matrix(c(1,2), 1,2,byrow=T), c(1,1), c(1,1), T)
plot(rnorm(10,0,1))
plot(rnorm(10,0,0.1))
mtext("Common Title", adj=-1.0, line=2)
par(def.par)


on 2/15/2006 11:22 AM Rodrigo Tsai said the following:

> Dear all,
>
> Many thanks for the help suggesting the use of "layout" cmd.
>
> How to insert a title in a 1x2 layout? The title is related to both graphs.
> I looked for it in help, unsuccessfully.
>
> Thanks in advance,
> Rodrigo.
>
> my reproductible code:
> ----------------------------------------------------------------------
>
> def.par <- par(no.readonly = TRUE)
>
> nf <- layout(matrix(c(1,2), 1,2,byrow=T), c(1,1), c(1,1), T)
>
> layout.show(nf)
>
>
>
> plot(rnorm(10,0,1))
>
> plot(rnorm(10,0,0.1))
>
> par(def.par)
>
> ----------------------------------------------------------------------
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>  

--

Michael Prager, Ph.D.
Population Dynamics Team, NMFS SE Fisheries Science Center
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516
http://shrimp.ccfhrb.noaa.gov/~mprager/
Opinions expressed are personal, not official.  No
government endorsement of any product is made or implied.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Re: common title for graphs in a (1x2) layout

Chuck Cleland
In reply to this post by Rodrigo Tsai
Rodrigo Tsai wrote:

> Dear all,
>
> Many thanks for the help suggesting the use of "layout" cmd.
>
> How to insert a title in a 1x2 layout? The title is related to both graphs.
> I looked for it in help, unsuccessfully.
>
> Thanks in advance,
> Rodrigo.
>
> my reproductible code:
> ----------------------------------------------------------------------
>
> def.par <- par(no.readonly = TRUE)
>
> nf <- layout(matrix(c(1,2), 1,2,byrow=T), c(1,1), c(1,1), T)
>
> layout.show(nf)
>
>
>
> plot(rnorm(10,0,1))
>
> plot(rnorm(10,0,0.1))
>
> par(def.par)
>
> ----------------------------------------------------------------------
>
> [[alternative HTML version deleted]]

RSiteSearch("Overall Title")

def.par <- par(no.readonly = TRUE)

par(oma = c(0, 0, 3, 0))

nf <- layout(matrix(c(1,2), 1,2,byrow=T), c(1,1), c(1,1), T)

layout.show(nf)

plot(rnorm(10,0,1))

plot(rnorm(10,0,0.1))

mtext("Centered Overall Title", outer = TRUE)

par(def.par)

Or without layout(), something like this:

par(mfrow=c(1,2), oma=c(0,0,2,0))
plot(1:10)
plot(1:10)
title("Centered Overall Title", outer=TRUE)

> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Reply | Threaded
Open this post in threaded view
|

Fwd: common title for graphs in a (1x2) layout

Rodrigo Tsai
Dear all,

Many thanks for your help, especially for RSiteSearch().

The problem was that I used mtext **before** the plots.
best regards
Rodrigo




---------- Forwarded message ----------
From: Chuck Cleland <[hidden email]>
Date: Feb 15, 2006 4:00 PM
Subject: Re: [R] common title for graphs in a (1x2) layout
To: Rodrigo Tsai <[hidden email]>
Cc: [hidden email]

Rodrigo Tsai wrote:
> Dear all,
>
> Many thanks for the help suggesting the use of "layout" cmd.
>
> How to insert a title in a 1x2 layout? The title is related to both
graphs.

> I looked for it in help, unsuccessfully.
>
> Thanks in advance,
> Rodrigo.
>
> my reproductible code:
> ----------------------------------------------------------------------
>
> def.par <- par(no.readonly = TRUE)
>
> nf <- layout(matrix(c(1,2), 1,2,byrow=T), c(1,1), c(1,1), T)
>
> layout.show(nf)
>
>
>
> plot(rnorm(10,0,1))
>
> plot(rnorm(10,0,0.1))
>
> par(def.par)
>
> ----------------------------------------------------------------------
>
>       [[alternative HTML version deleted]]

RSiteSearch("Overall Title")

def.par <- par(no.readonly = TRUE)

par(oma = c(0, 0, 3, 0))

nf <- layout(matrix(c(1,2), 1,2,byrow=T), c(1,1), c(1,1), T)

layout.show(nf)

plot(rnorm(10,0,1))

plot(rnorm(10,0,0.1))

mtext("Centered Overall Title", outer = TRUE)

par(def.par)

Or without layout(), something like this:

par(mfrow=c(1,2), oma=c(0,0,2,0))
plot(1:10)
plot(1:10)
title("Centered Overall Title", outer=TRUE)

> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
>

--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html