title: Combining 3 barplots in a single column
body: <p>I have generated 3 bar plots using barplot() function. Now I need to combine these 3 plots in a single column and get another new plot. I have used cowplot to do so however it showed warning message</p>
  <blockquote>
  <p>In as_grob.default(plot) :Cannot convert object of class matrixarray
  into a grob.</p>
  </blockquote>
  <p>I know it is easier with ggplot. But I find it hard to write this code in ggplot. Can someone please give me a solution? I am not an expert but I tried my best but could not find a solution. <a href="https://i.stack.imgur.com/jEEuu.png" rel="nofollow noreferrer">My code</a>:</p>
  <pre><code>k &lt;- readr::read.csv(&quot;maxcor_r_p.csv&quot;, TRUE, &quot;,&quot;)
  cols &lt;- c(&quot;azure3&quot;, &quot;#003f5c&quot;)[(k$p &lt; 0.05) + 1]
  maxi &lt;- barplot(
    k$r,
    names.arg = k$parameter,
    ylab = &quot;Correlation coefficient&quot;,
    col = cols,
    main = expression(&quot;T&quot;[max]),
    las = 2
    )
  
  l &lt;- readr::read.csv(&quot;meancor_r_p.csv&quot;, TRUE, &quot;,&quot;)
  cols &lt;- c(&quot;azure3&quot;, &quot;#27e52a&quot;)[(l$p &lt; 0.05) + 1]
  meany &lt;- barplot(
    l$r,
    names.arg = l$parameter,
    ylab = &quot;Correlation coefficient&quot;,
    col = cols,
    main = expression(&quot;T&quot;[mean]),
    las = 2
    )
  
  m &lt;- readr::read.csv(&quot;precipcor_r_p.csv&quot;, TRUE, &quot;,&quot;)
  cols &lt;- c(&quot;azure3&quot;, &quot;#27bac6&quot;)[(m$p &lt; 0.05) + 1]
  preci &lt;- barplot(
    m$r,
    names.arg = m$parameter,
    ylab = &quot;Correlation coefficient&quot;,
    col = cols,
    main = expression(&quot;Precipitation&quot;),
    las = 2
    )
  
  cowplot::plot_grid(
    maxi, meany, preci, 
    ncol = 1, align = &quot;v&quot;, axis = 1
    )
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/juurM.png" rel="nofollow noreferrer">screenshot of my 1 csv file</a></p>