title: Centring legend below two plots in r
body: <p>I would like to centre a common legend below two plots. I have used <code>xpd=TRUE</code> to allow for printing outside the plot itself and oma to create space for the legend. However the legend will not move horizonatally and gets clipped 'early' vertically. Any advice? </p>
  
  <pre><code>quartz(title="PCoA",12,6)
  par(mfrow=c(1,2),oma=c(5,0,0,0),xpd=TRUE)
  
  plot(1:3,4:6,main="plot 1")
  
  plot(1:3,4:6,main="plot 2")
  
  
  # Clips the plot    
  legend(1,3.5,ncol=3,c("0-1 km","1-5 km","outside barrier"),fill=c("green","orange","red"), title="Fetch")
  
  # Won't let me move the legend sideways 
  legend(0,3.5,ncol=3,c("0-1 km","1-5 km","outside barrier"),fill=c("green","orange","red"), title="Fetch")
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/YCwYA.png" alt="enter image description here"></p>
  
  <p>UPDATE</p>
  
  <p>With the solution below it cuts of the edge of the graph which becomes visible by changing the dimension of the figure by dragging the edge (see below). Any ideas what might be going on?</p>
  
  <p><img src="https://i.stack.imgur.com/IeOqN.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/13IF0.png" alt="enter image description here"></p>