title: Is it possible for matplotlib's alpha transparency values to "sum" to 1?
body: <p>I am using matplotlib to plot a series of horizontal lines that overlap.  I would like to indicate (in a very rough way) how much overlap there is via transparency.  For example if I have ten lines and 5 of them overlap over a certain interval, I would like that interval to have an alpha value of 0.5.  If all of them overlap over a certain interval then the interval should have an alpha value of 1.0. The following code should illustrate what I want:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  
  y = [1,1,1,1,1,1,1,1,1,1]
  x_start = [0,0,0,0,0,0,0,0,0,0]
  x_end = [1,2,3,4,5,6,7,8,9,10]
  
  plt.hlines(y, x_start, x_end, linewidth=7, colors='red', alpha=0.1)
  plt.hlines(1.2, 0, 10, linewidth=7, colors='red', alpha=1)
  plt.ylim(0.8, 1.4)
  plt.show()
  </code></pre>
  
  <p><img src="https://i.imgur.com/30TGimI.png" alt="Image of two lines with different transparencies"></p>
  
  <p>I would like the transparency of the red from x=0 to x=1 for the line at y=1 to be the same as that of the horizontal line at y=1.2 (not transparent at all).  However this is not the case.</p>
  
  <p>Is there a way to achieve what I want with matplotlib and the alpha values?  I will know the total number of lines that can possibly overlap (i.e., how many lines overlapping should correspond to 0 transparency).</p>