title: Overlapping alpha transparency to create a density plot in matplolib
body: <p>I want to create a plot using matplotlib. I basically draw many lines which overlap. I want to set alpha transparency on these lines such that if lines overlap the alpha values add up. My intention is to show the density of the overlapping lines with a more solid color, and lines that don't should be shown very lightly, this is the code I have but it is not giving the desired efect:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  dt = 0.00008
  nstep = 3000
  paths = 100
  
  X = np.zeros((nstep,paths))
  Y = np.zeros((nstep,paths))
  gv1 = np.sqrt(dt)*np.random.randn(nstep,paths)
  gv2 = np.sqrt(dt)*np.random.randn(nstep,paths)
  for i in range(nstep-1):
          X[i+1] = X[i] + gv1[i]
          Y[i+1] = Y[i] + gv2[i]
  plt.plot(X,Y,lw=1,alpha=0.05)
  plt.show()
  </code></pre>