0

I'm using Markdown to write my thesis dissertation.
Basically I split the screen to arrange two plot in one, but I would like to reduce the size of the entire plot. So i did this:

figs <- rbind(c(0, 0.5, 0, 0.8),   # Screen1 reduced from 1 to 0.8
              c(0.5, 1, 0, 0.8))    # Screen2 reduced from 1 to 0.8

colnames(figs) <- c("W", "E", "S", "N")
rownames(figs) <- c("Screen1", "Screen2")
screenIDs <- split.screen(figs)
names(screenIDs) <- rownames(figs)

# Left Side plot:
screen(screenIDs["Screen1"])
par(mar=c(4,4,2,1)+.1)
qqnorm(...)
qqline(...)

op <- par(fig=c(0.01,.3,.35,.78), new=TRUE)
hist(...)
lines(a,dnorm(a,mean(residuals.arima), sd(residuals.arima)), lty=1, col="darkblue", lwd=2)
box()
par(op)

#Right side plot:
screen(screenIDs["Screen2"]) 
par(mar=c(4,4,2,1)+.1)

plot(...)
lines(...)

Unfortunately what I get is the following (I've highlighted the extra space in red):

enter image description here

so it seems I just reduce the plot size but not the total plotting output size. How can I deal with it? I don't want to fill the gap with my picture since it would be too big.

toyo10
  • 121
  • 1
  • 14
  • Could we see the whole chunk and any chunk options you are using? Or does this help: https://stackoverflow.com/questions/43195871/adjusting-figure-margins-in-rmarkdown – Ryan Morton Mar 20 '18 at 18:22
  • Is the space also there when plotted without rmarkdown? If yes then you need to reduce the top margin by chaning `par(mar=)` settings. if not then it should be controlled by knitr or latex parameters. – Karolis Koncevičius Mar 28 '18 at 10:35
  • yes it's also present in that case! Where I need to put it? – toyo10 Mar 31 '18 at 13:31

0 Answers0