How do you make line segments between two points and find out how many points intersect the line?
<p>I have code that generates all the possible lines between points:</p>

<pre><code>import matplotlib.pyplot as plt
import matplotlib.lines as lines
import itertools 

fig=plt.figure()
ax=fig.add_subplot(111)
all_data = [[1,10],[2,10],[3,10],[4,10],[5,10],[3,1],[3,2],[3,3],[3,4],[3,5]]
x, y = zip(*all_data)
plt.scatter(x,y)
for pair in itertools.combinations(all_data,2):
    line=lines.Line2D(*zip(*pair))
    line.set_color('brown')
    ax.add_line(line)

plt.show()
</code></pre>

<p><img src="http://i.stack.imgur.com/kbe2A.png" alt="enter image description here"></p>

<p>but I want how many points each line intersects. (points are blue)</p>
