title: Align Multiple plots in R, with the same x-axis
body: <p>I want to plot multiple time-series figures. I want them to be aligned on the same x axis. </p>
  
  <p>However, due to the different quantity of y in the different plots, it is hard to simply plot them together. Y-labels take different space.</p>
  
  <p>Is there any other way to align x-axis.</p>
  
  <pre><code>grid.newpage() 
  pushViewport( viewport( layout=grid.layout( 4, 1 ) ) ) 
  vplayout&lt;-function( x, y ) viewport( layout.pos.row=x, layout.pos.col=y ) 
  print( plot1, vp=vplayout( 1, 1 ) )
  print( plot2, vp=vplayout( 2, 1 ) ) 
  print( plot3, vp=vplayout( 3, 1 ) ) 
  print( plot4, vp=vplayout( 4, 1 ) ) 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/8nby1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8nby1.png" alt="enter image description here"></a></p>