title: LineCollection animation when updating the frames in a loop
body: <p>The following code supposed to do the same thing <a href="https://stackoverflow.com/questions/20053964/animation-based-on-only-updating-colours-in-a-plot">here</a> where lines colours are updated during an animation. However, the colour is not being updated. Which part of this code is wrong?</p>
  
  <pre><code>import numpy as np
  from matplotlib import pyplot as plt
  from matplotlib.collections import LineCollection
  import matplotlib.animation as animation
  
  lines = []
  for i in range(10):
      for j in range(10):
          lines.append([(0, i), (1, j)])
  
  fig, ax = plt.subplots()
  colors = np.random.random(len(lines))
  col = LineCollection(lines, array=colors, cmap=plt.cm.gray)
  ax.add_collection(col)
  ax.autoscale()
  
  ims = []
  for i in range(100):
      colors = np.random.random(len(lines))
      col.set_array(colors)
      ims.append([ax.add_collection(col)])
  ani = animation.ArtistAnimation(fig, ims, interval=200, blit=True,repeat_delay=10000)
  plt.show()
  </code></pre>
  
  <p>The output I get from the above code is below
  <img src="https://i.stack.imgur.com/GNmyL.png" alt="code output"></p>