title: change the line color during animation in matplotlib
body: <p>Normally we change the data of x, y, z for animation in matplotlib using set_data, or set_3d_properties. Then can you change the line color also? The below is to draw lines randomly with increasing the number of lines. And if there are many lines, I cannot see what is going on but I want to show which line is added at the last moment. For example, in a certain moment only one line is blue while all the other lines are black. Then in the next frame, new line is added with blue and then the previous blue line is changed into black.</p>
  
  <p>The below is adding-line program. I have done it before but I can't remember how I did. But at this time, I want to do it with conserving the structure of the below animation program</p>
  
  <pre><code>from mpl_toolkits.mplot3d import Axes3D
  import matplotlib.pyplot as plt
  import matplotlib.animation as animation
  from random import random
  fig=plt.figure()
  ax=fig.gca(projection='3d')
  MAX=100
  lines=[]
  for i in range(MAX):
      lines.append(ax.plot([],[],[], color='k')[0])              # &lt;type 'list'&gt;, list of plot
  def init():
      for i in range(MAX):
          lines[i].set_data([],[])
          lines[i].set_3d_properties([])
      return lines
  def update(num):
      xi=random()
      yi=random()
      zi=random()
      xf=random()
      yf=random()
      zf=random()
      x=[xi,xf]
      y=[yi,yf]
      z=[zi,zf]
      lines[num].set_data(x,y)
      lines[num].set_3d_properties(z)
      return lines
  mc_ani=animation.FuncAnimation(fig, update, 10, init_func=init, interval=1000, blit=False, repeat=True)
  ax.set_xlim3d([-0.1, 1.1])
  ax.set_ylim3d([-0.1, 1.1])
  ax.set_zlim3d([-0.1, 1.1])
  ax.set_xlabel('X')
  ax.set_ylabel('Y')
  ax.set_zlabel('Z')
  plt.show()
  </code></pre>