0

I have been working on a multi-panel figure in R. It displays a lot of plots/graphs... a number of rows and a number of columns. When I add titles to the ONLY the top row, they appear above the output rendering. Either it's too far above or it gets cut off.

The multipanel is pretty big, about six rows with three columns each. As every column represents the same thing, I figured to add titles above all of them. The titles at first were directly on the graph so I decided to raise them using the following:

title(main = "Title Example ", cex.main=1.7 , line = 1)

This elevates things nicely. But it goes way too high.

Previously I had issues with the size being too large. It was solved using one of the following two:

par(mar=c(1,1,1,1))

or

dev.new(width=16,height=10)

The titles just appear above the stuff. Any suggestions for what can be done to fix this?

I am hoping that the final output could just "lower" everything by a little bit.

But also, the output generation panel does not have a "scroll" sort of element. Would be nice if I can do that too... The monitor has only so much size, which does not fit the 6 x 3 fully.

bbiasi
  • 1,549
  • 2
  • 15
  • 31
Geogeo2019
  • 51
  • 6
  • It will be a bit difficult to help with descriptions alone. Please make this question *reproducible*. This includes sample code (including listing non-base R packages), sample *unambiguous* data (e.g., `dput(head(x))` or `data.frame(x=...,y=...)`), and expected output. Refs: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Jun 06 '19 at 00:20
  • As a quick fix, try margins at 0.5 `par(mar=c(0.5,0.5,0.5,0.5))`. – M.Viking Jun 06 '19 at 00:21
  • Well, here is some code, the first panel: par(mar=c(1,1,1,1)) par(mfrow = c(6,3)) par(pty="s") par(mar=c(1, 1, 1, 0.5)) plot(y1t ~ x1t, col = "white", main=" ", xlab=" ", ylab=" " ) lines(y4t ~ x1t,lwd=4,col="blue",lty="dotted") mtext(col="black", font=2, "A.", cex=1.5, side=2, line=2, at=par('usr')[4], las=2) mtext(side=2, line=3, "Variable", col="black", font=2, cex=1.2) title(main = "Main title", cex.main=1.7 , line = 1) I have more lines and stuff in the graphs, but what's in them isn't so important at the time being I suppose. – Geogeo2019 Jun 06 '19 at 00:41

1 Answers1

0

It looks like it was fixed by using "par(mar=c(0.5, 7, 1.5, 0.5))"... this code increased the margin and so it worked.

Geogeo2019
  • 51
  • 6