Dear all,
I have a 3x2 plot and in addition to the title of the individual plots I
would like to have an overall title
for each row. I managed to get an overall title for the whole plot matrix
with mtext:
par(mfrow=(c(3,2)), mar=c(6.4,4.5,4.2, 1.8), oma=c(0,0,3,0))
for (i in 1:6)
barplot(sample(1:10,5), main=paste("Plot #",i))
mtext("Overall Title Row 1", outer=TRUE)
but I cannot put an overall title in the middle above the titles of the
plots in the second or third row.
If I use mtext within the loop, I can only add another title above an
individual plot.
I hope someone can help me, many thanks in advance
Hannes
--
View this message in context: http://r.789695.n4.nabble.com/multi-panel-figure-overall-title-for-each-row-tp4647148.html
Sent from the R help mailing list archive at Nabble.com.
multi-panel figure: overall title for each row
3 messages · capy_bara, Jean V Adams, Bert Gunter
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20121024/77dd6e40/attachment.pl>
A perhaps more "elegant" way to do it would be to use the ?layout function rather than the ancient mfrow() to create space for both titles and graphs. You could then e.g. "draw" your titles in the space you created for titles. -- Bert
On Wed, Oct 24, 2012 at 5:33 AM, Jean V Adams <jvadams at usgs.gov> wrote:
Hannes,
A bit inelegant, but it works. Try this:
mtext("Overall Title Row 2", outer=TRUE, line=-17)
mtext("Overall Title Row 3", outer=TRUE, line=-34)
Jean
capy_bara <hettling at few.vu.nl> wrote on 10/23/2012 09:08:39 AM:
Dear all, I have a 3x2 plot and in addition to the title of the individual plots I would like to have an overall title for each row. I managed to get an overall title for the whole plot
matrix
with mtext:
par(mfrow=(c(3,2)), mar=c(6.4,4.5,4.2, 1.8), oma=c(0,0,3,0))
for (i in 1:6)
barplot(sample(1:10,5), main=paste("Plot #",i))
mtext("Overall Title Row 1", outer=TRUE)
but I cannot put an overall title in the middle above the titles of the
plots in the second or third row.
If I use mtext within the loop, I can only add another title above an
individual plot.
I hope someone can help me, many thanks in advance
Hannes
[[alternative HTML version deleted]]
______________________________________________ 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.
Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm