title: Issues with ggdraw since ggplot2 update
body: <p>I made a figure with the following code, however, I recently noticed some of my data points did not contain error bars as they should, so I am revisiting this code a few months after writing it. In this time there has been an update to ggplot2 and now I get errors in my code that I do not know how to fix. These are detailed below.</p>
  
  <p>My code is:</p>
  
  <pre><code>p1 &lt;- ggplot(dat3A, aes(x = d15N, y = Depth))
  
  p4 &lt;- p1 + 
      geom_point(size = 1) + 
      geom_path() + 
      scale_y_continuous(expand =  c(0, 0), limits = c(15,0), trans = "reverse") + 
      scale_x_continuous(expand = c(0, 0), limits = c(0,20)) + 
      labs(x=expression(paste(delta^'15', N[NO3],('\u2030'))), y='Depth (cm)') + 
      theme_bw() + 
      theme(axis.line = element_line(colour = "black"), 
          panel.grid.major = element_blank(), 
          panel.grid.minor = element_blank(),    
          panel.border = element_blank(), 
          panel.background = element_blank()) +
      geom_errorbarh(aes(xmax=d15N+d15NError, xmin=d15N-d15NError))+ 
      ggtitle("d") + 
      theme(plot.title = element_text(hjust = 0, size=8))+
      theme(axis.text = element_text(size=6), axis.title=element_text(size=8))
  p13 &lt;- ggdraw(switch_axis_position(p4, axis = 'x'))
  </code></pre>
  
  <p>When I run this all runs okay until I come to the last line of code <code>p13 &lt;- ggdraw(switch_axis_position(p4, axis = 'x'))</code></p>
  
  <p>Then I get the following errors:</p>
  
  <blockquote>
    <p>Error in gt$grobs[[ixl]] : attempt to select less than one element In
    addition: Warning messages: 1: <code>panel.margin</code> is deprecated. Please
    use <code>panel.spacing</code> property instead  2: Removed 1 rows containing
    missing values (geom_errorbarh).</p>
  </blockquote>
  
  <p>I am not an experienced coder and so I am unsure how to solve these errors. I do not use panel.margin in my code so am not sure how to change this to panel.spacing. If anyone could provide any help on this as well as the <code>gt$grobs[[ixl]]</code> error I would really appreciate it!</p>