title: R | combine plots that use par(mfrow = ...) internally
body: <p>Take <code>plot.acf</code> as an example. Both <code>acf</code> and <code>pacf</code> call this function internally. How can i plot them side by side?</p>
  
  <p><strong>Example</strong>:</p>
  
  <pre><code>TS &lt;- ts.union(mdeaths, fdeaths)
  acf(TS)
  pacf(TS)
  </code></pre>
  
  <p>I tried to use <code>par(mfrow = c(2,4))</code> and <code>layout</code> to combine them, but <code>stats:::plot.acf</code> overwrites this. The expected output would be:</p>
  
  <p><img src="https://i.stack.imgur.com/zgXYB.png" alt="enter image description here"></p>