title: How to clear all subplots without closing the figure?
body: <pre class="lang-py prettyprint-override"><code>import numpy as np
  import matplotlib.pyplot as plt
  from mpl_toolkits.mplot3d import Axes3D
  
  N = 50
  
  fig = plt.figure()
  
  ax = fig.add_subplot(1, 2, 1, projection='3d')
  ax.set_title('Cartesian Plot')
  
  # im = fig.add_subplot(1, 2, 2)
  # im.set_title('Image')
  # im.axis('off')
  
  plt.ion()
  plt.show()
  
  for p in range(10):
      Z = np.random.randint(255, size=(N, N, 3))
      A, B, C = Z[:, 0], Z[:, 1], Z[:, 2]
      ax.scatter(A, B, C, c='r', marker='.')
      # im.imshow(Z)
  
      plt.draw()
      plt.pause(1)
      plt.cla()
  
  plt.ioff()
  plt.close()
  </code></pre>
  
  <p>I am trying to plot an image and it's Cartesian plot again and again after it is modified, so I set up this example. This code works if you comment out the image part, then the Cartesian plot is cleared properly. But, if you add the image subplot (uncomment the <code>im</code> subplot) than instead of clearing and redrawing all the subplots, they are drawn over each other which is a problem for the plot in the Cartesian space.</p>
  
  <p>Could someone help me? After each iteration of the loop I want both subplots to be cleared and redrawn for the next iteration and so forth.</p>
  
  <p>I would also like the numbers labelling the axis to not show, for the image I did <code>im.axis('off')</code> but that only works for the first iteration and than it is set to default.</p>