title: Scatter Animation python
body: <p>I have my data file containing x,y coordinates of a fractal. I want to get a animation of this coordinates. </p>
  
  <p>I have tried this code. </p>
  
  <pre class="lang-py prettyprint-override"><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.animation as animation
  
  data1=np.loadtxt('data.txt')
  
  fig = plt.figure()
  ax = plt.axes()
  scat = ax.scatter([], [])
  
  def init():
          scat.set_offsets([])
      return scat
  
  def animate(i):
      scat.set_offsets(data1)
      return scat
  
  anim = animation.FuncAnimation(fig, animate, init_func=init,
                                 frames=700, interval=1, blit=True)
  
  plt.show()
  </code></pre>
  
  <p>Error is 'PathCollection' object is not iterable.
  I don't know much, any help will be thankful.</p>