The more common approach (not exactly what the questioner asked) is to use the plot interface. This involves Line2D behind the scenes. 
>>> x = [10,24,23,23,3]
>>> y = [12,2,3,4,2]
>>> import matplotlib.pyplot as plt
>>> plt.plot(x,y)
[]
>>> plt.show()