title: Updating z data on a surface_plot in Matplotlib animation
body: <p>I am looking to create an animation in a surface plot. The animation has fixed x and y data (1 to 64 in each dimension), and reads through an np array for the z information. An outline of the code is like so:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt 
  import matplotlib.animation as animation
  
  def update_plot(frame_number, zarray, plot):
      #plot.set_3d_properties(zarray[:,:,frame_number])
      ax.collections.clear()
      plot = ax.plot_surface(x, y, zarray[:,:,frame_number], color='0.75')
  
  fig = plt.figure()
  ax = plt.add_subplot(111, projection='3d')
  
  N = 64
  x = np.arange(N+1)
  y = np.arange(N+1)
  x, y = np.meshgrid(x, y)
  zarray = np.zeros((N+1, N+1, nmax+1))
  
  for i in range(nmax):
    #Generate the data in array z
    #store data into zarray
    #zarray[:,:,i] = np.copy(z)
  
  plot = ax.plot_surface(x, y, zarray[:,:,0], color='0.75')
  
  animate = animation.FuncAnimation(fig, update_plot, 25, fargs=(zarray, plot))
  plt.show()
  </code></pre>
  
  <p>So the code generates the z data and updates the plot in FuncAnimation. This is very slow however, I suspect it is due to the plot being redrawn every loop.</p>
  
  <p>I tried the function</p>
  
  <pre><code>ax.set_3d_properties(zarray[:,:,frame_number])
  </code></pre>
  
  <p>but it comes up with an error </p>
  
  <pre><code>AttributeError: 'Axes3DSubplot' object has no attribute 'set_3d_properties'
  </code></pre>
  
  <p>How can I update the data in only the z direction without redrawing the whole plot? (Or otherwise increase the framerate of the graphing procedure)</p>