title: Animate points with labels with matplotlib
body: <p>I've got an animation with lines and now I want to label the points.
  I tried <code>plt.annotate()</code> and I tried <code>plt.text()</code> but the labes don't move.
  This is my example code:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import matplotlib.animation as animation
  
  def update_line(num, data, line):
      newData = np.array([[1+num,2+num/2,3,4-num/4,5+num],[7,4,9+num/3,2,3]])
      line.set_data(newData)
      plt.annotate('A0', xy=(newData[0][0],newData[1][0]))
      return line,
  
  
  fig1 = plt.figure()
  
  data = np.array([[1,2,3,4,5],[7,4,9,2,3]])
  l, = plt.plot([], [], 'r-')
  plt.xlim(0, 20)
  plt.ylim(0, 20)
  plt.annotate('A0', xy=(data[0][0], data[1][0]))
  # plt.text( data[0][0], data[1][0], 'A0')
  
  line_ani = animation.FuncAnimation(fig1, update_line, 25, fargs=(data, l),
      interval=200, blit=True)
  plt.show()
  </code></pre>
  
  <p>Can you help me please?</p>
  
  <p>My next step is:
  I have vectors with origin in these Points. These vectors change their length and their direction in each animation step.
  How can I animate these?</p>
  
  <p>Without animation this works:</p>
  
  <pre><code>soa =np.array( [ [data[0][0],data[1][0],F_A0[i][0][0],F_A0[i][1][0]],
                 [data[0][1],data[1][1],F_B0[i][0][0],F_B0[i][1][0]],
                 [data[0][2],data[1][2],F_D[i][0][0],F_D[i][1][0]] ])
  X,Y,U,V = zip(*soa)
  ax = plt.gca()
  ax.quiver(X,Y,U,V,angles='xy',scale_units='xy',scale=1)
  </code></pre>
  
  <p>First thanks a lot for your fast and very helpful answer!</p>
  
  <p>My Vector animation problem I have solved with this:</p>
  
  <pre><code>annotation = ax.annotate("C0", xy=(data[0][2], data[1][2]), xycoords='data',
      xytext=(data[0][2]+1, data[1][2]+1), textcoords='data',
      arrowprops=dict(arrowstyle="-&gt;"))
  </code></pre>
  
  <p>and in the 'update-function' I write:</p>
  
  <pre><code>annotation.xytext = (newData[0][2], newData[1][2])
  annotation.xy = (data[0][2]+num, data[1][2]+num)
  </code></pre>
  
  <p>to change the start and end position of the vectors (arrows).</p>
  
  <p>But what is, wehn I have 100 vectors or more? It is not practicable to write:</p>
  
  <pre><code>annotation1 = ...
  annotation2 = ...
      .
      :
  annotation100 = ...
  </code></pre>
  
  <p>I tried with a list:</p>
  
  <pre><code>...
  annotation = [annotation1, annotation2, ... , annotation100]
  ...
  
  def update(num):
      ...
      return line, annotation
  </code></pre>
  
  <p>and got this error:
  AttributeError: 'list' object has no attribute 'axes'</p>
  
  <p>What can I do? Have you any idea?</p>