title: Animating the motion of a particle in 3D in Python
body: <p>I have 3xN array  positions that vary in time for a particle. I want to take the coordinates at each time point, plot that position as a point on a 3D axis and then repeat, creating an animation.</p>
  
  <p>I can create a single image of this effect using matplotlib's Axes3D</p>
  
  <pre><code>x_a = particle_a[:,0]
  y_a = particle_a[:,1]
  z_a = particle_a[:,2]
  
  fig = plt.figure()
  ax = fig.add_subplot(111, projection='3d')
  
  
  ax.scatter(x_a, y_a, z_a, c='b')
  plt.show
  </code></pre>
  
  <p>'particle_a' is just an array of shape (N,3) where N is the number of timepoints.</p>
  
  <p>How can I animate this? </p>