title: In Matplotlib, how do I include a 3D plot as an inset?
body: <p>I'm currently able to do insets, but only in 2D.  Adding <code>projection='3d'</code> to <code>fig1.add_axes()</code> or <code>inset_axes()</code> in the code below will not work.</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from mpl_toolkits.mplot3d import axes3d
  from mpl_toolkits.axes_grid.inset_locator import inset_axes
  
  x = np.linspace(0,2.0*np.pi,51)
  y = np.sin(x)
  
  def make_plot(x,y):
      fig = plt.figure(figsize=(10,7))
      rect = [0.18,0.18,0.25,0.25]
      ax = fig.add_subplot(111)
      ax.grid()
      ax.set_xlim(x.min(),x.max())
      ax.plot(x,y,'bo-')
  
      fig1 = plt.gcf()
      ax_inset1 = fig1.add_axes(rect,anchor='NW',axisbg=None)  # , projection='3d')
      ax_inset2 = inset_axes(ax, width="40%", height=1.8, loc=1)  # , projection='3d')
      ax_inset1.plot(x,y,'r--'); ax_inset1.set_xlim(x.min(),x.max())
      ax_inset2.plot(x,y,'g--'); ax_inset2.set_xlim(x.min(),x.max())
  
      X, Y, Z = axes3d.get_test_data(0.05)
      #ax_inset1.plot_wireframe(X, Y, Z, rstride=10, cstride=10)
  
      plt.show()
  
  make_plot(x,y)
  </code></pre>
  
  <p>Image generated by the above code is included below:</p>
  
  <p><img src="https://i.stack.imgur.com/Ewo9X.png" alt="inset">]<a href="https://i.stack.imgur.com/Ewo9X.png" rel="nofollow noreferrer">1</a></p>
  
  <p>How can I change the code above so that one (or both) of the insets has a 3D plot?</p>