title: Python functions that return Matplotlib axes--how do you combine them all in one figure?
body: <p>Let's say that I made functions that return an axes object.  For example, say a plot of a sine and cosine function.  </p>
  
  <pre><code>def func1():
      fig, ax = plt.subplots()
      x = np.linspace(0, 2*np.pi)
      ax.plot(x, np.sin(x))
      return ax
  
  def func2():
      fig, ax = plt.subplots()
      x = np.linspace(0, 2*np.pi)
      ax.plot(x, np.cos(x))
      return ax
  </code></pre>
  
  <p>These functions return, of course, the following plots:</p>
  
  <p><a href="https://i.stack.imgur.com/mLiI0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mLiI0.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/enoNN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/enoNN.png" alt="enter image description here"></a></p>
  
  <p>How can I combine the two into one figure which would be equivalent to the following code and image?</p>
  
  <pre><code>fig, ax = plt.subplots()
  xs = np.linspace(0, 2 * np.pi)
  ax.plot(x, np.cos(x))
  ax.plot(x, np.sin(x))
  plt.show()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/sskhr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sskhr.png" alt="enter image description here"></a></p>
  
  <p>That is to say, could I do something like the pseudocode below?</p>
  
  <pre><code>ax1 = func1()
  ax2 = func2()
  
  fig = plt.figure()
  fig.append_axes(ax1)
  fig.append_axes(ax2)
  
  plt.show()
  </code></pre>