Store the points in the same vertical line i . e . with same X co - ordinates
for i in range ( N ) : NEW_LINE INDENT if vertical [ X [ i ] ] is None : NEW_LINE INDENT vertical [ X [ i ] ] = [ Y [ i ] ] ; NEW_LINE DEDENT else : NEW_LINE INDENT vertical [ X [ i ] ] . append ( Y [ i ] ) ; NEW_LINE DEDENT DEDENT