title: What is the fastest way to plot a huge amount of lines in matplotlib?
body: <p>In a project I'm working on I have to plot a huge amount of lines into one figure. Therefore I am using a for loop like this: </p>
  
  <pre><code>for i in xrange(0,len(x)):
       ax[plotId].plot(x[i],y[i],color = usedColors[i])
  </code></pre>
  
  <p>Unfortunately, this loop needs around 0.8 seconds which is to much for me since I use matplotlib in an interactive way (the user is able to change the plot with integrated buttons. Is there an alternative way to do this? For example write all the related data in a list while loading the GUI:</p>
  
  <pre><code>l = [x[0],y[0],usedColors[0],x[1],x[2]....]
  </code></pre>
  
  <p>and use this list somehow to write the data in plot() without using a loop (which is not working because ax[plotId].plot cannot interpret this list in a proper way):</p>
  
  <pre><code>ax[plotId].plot(l)
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p><strong>Update:</strong> 
  I was looking for <code>LineCollection</code></p>