title: How can I move several existing plots to one subplot in MATLAB?
body: <p>I have a function, <code>myFunkyFigure</code>, that takes in data, does some funky things, and returns an axis object for the figure it produces.</p>
  
  <p>I would like to be able to invoke this function twice, creating two different figures:</p>
  
  <pre><code>fig(1) = myFunkyFigure(dataSet1);
  fig(2) = myFunkyFigure(dataSet2);
  </code></pre>
  
  <p>Then I would like to put them into a subplot together.</p>
  
  <p>Note that, because of the funkiness of <code>myFunkyFigure</code>, the following does not work.</p>
  
  <pre><code>subplot(2,1,1);
  myFunkyFigure(dataSet1);
  subplot(2,1,2);
  myFunkyFigure(dataSet2);
  </code></pre>
  
  <p>I believe that I need something along the lines of <code>copyobj</code>, but I haven't been able to get that to work (I tried following <a href="https://stackoverflow.com/questions/4008880">a solution in Stack Overflow question <em>Producing subplots and then combine them into a figure later in MATLAB</em></a> but to no avail).</p>