title: I can't get my plots to a single grid please help correct my code
body: <p>I have 11 plots and used a looping function to plot them see my code below. However, I can't get them to fit in just 1 page or less. The plots are actually too big. I am using R software and writing my work in RMarkdown. I have spent almost an entire week trying to resolve this.</p>
  <pre><code>  group_by(Firm_category) %&gt;%
    doo(
      ~ggboxplot(
        data =., x = &quot;Means.type&quot;, y = &quot;means&quot;,
        fill =&quot;grey&quot;, palette = &quot;npg&quot;, legend = &quot;none&quot;,
        ggtheme = theme_pubr()
        ), 
      result = &quot;plots&quot;
    )
  graph3
  
  # Add statistical tests to each corresponding plot
  
  Firm_category &lt;- graph3$Firm_category
  xx &lt;- for(i in 1:length(Firm_category)){
    graph3.i &lt;- graph3$plots[[i]] + 
      labs(title = Firm_category[i]) +
      stat_pvalue_manual(stat.test[i, ], label = &quot;p.adj.signif&quot;)
    print(graph3.i)
  }
  
  #output3.long data sample below as comments
  #Firm_category  billmonth  Means.type  means
  #Agric          1           Before       38.4444
  #Agric          1           After        51.9
  
  </code></pre>
  <p>Complete data is on my github: <a href="https://github.com/Fridahnyakundi/Descriptives-in-R/blob/master/Output3.csv" rel="nofollow noreferrer">https://github.com/Fridahnyakundi/Descriptives-in-R/blob/master/Output3.csv</a>
  This code prints all the graphs but in like 4 pages. I want to group them into a grid. I have tried to add all these codes below just before my last curly bracket and none is working, please help me out.</p>
  <pre><code>library(cowplot)
  print(plot_grid(plotlist = graph3.i[1:11], nrow = 4, ncol = 3))
  
  library(ggpubr)
  print(ggarrange(graph3.i[1:11], nrow = 4, ncol = 3))
  </code></pre>
  <p>I tried the gridExtra command as well (they all seem to do the same thing). I am the one with a mistake and I guess it has to do with my list. I read a lot of similar work here, some suggested</p>
  <pre><code>dev.new() 
  dev.off()
  </code></pre>
  <p>I still didn't get what they do. But adding either of them caused my code to stop.
  I tried defining my 'for' loop function say call it 'XX', then later call it to make a list of graph but it returned NULL output.</p>
  <p>I have tried defining an empty list (as I read in some answers here) then counting them to make a list that can be printed but I got so many errors.
  I have done this for almost 3 days and will appreciate your help in resolving this.
  Thanks!</p>