I have 24 boxplots, each of it comparing an environmental parameter from two different sites. I like to plot them in one figure with 4 plots in the first row, 5 plots in the second row, 5 plots in the third row, 6 plots in the fourth row and 4 plots in the fifth row. This order is of importance, as by this each row contains a set of related parameters, e.g. abiotic parameters like median grain size, sediment porosity, water content etc.
My approach was to use the split.screen function:
split.screen(c(4,1))
# [1] 1 2 3 4
split.screen(c(1,4), screen=1)
# [1] 5 6 7 8
split.screen(c(1,5), screen=2)
# [1] 9 10 11 12 13
split.screen(c(1,5), screen=3)
# [1] 14 15 16 17 18
split.screen(c(1,6), screen=4)
# [1] 19 20 21 22 23 24
split.screen(c(1,4), screen=5)
# [1] 25 26 27 28
Then I start to include the plots:
screen(5)
boxplot(Data$Parameter1 ~ Data$Sites)
screen(6)
boxplot(Data$Parameter2 ~ Data$Sites)
and so on
Until the fourth row it is working, but when I like to add the first plot of the fifth row
Error in plot.new() : figure margins too large
appears.
I already sized up the plot-window to the maximum on my screen following suggestions from: Error in plot.new() : figure margins too large in R
and made the margins smaller following suggestions from: Error in plot.new() : figure margins too large, Scatter plot
using
par(mar=c(0.1,0.1,0.1,0.1)
but nothing worked out. I assume, that the size of my plot-window is to small to display the entire figure (even if I maximise the size). Therefore, I like to ask:
Is there a way to create such a figure without showing it in the plot-window?
Please be aware that I am not an R expert, not familiar with ggplot and not a coder. Therefore, if you have a solution for my problem, please explain it logically comprehensible and like you would explain it to a 9-years-old - that works quite good for me. Thank you for the effort in advance.
x11()
. – Vandenman