I want to do an animation with lines in matplotlib. Basically, the line is 2 points, and each point is (x,y) coordinates. Each next lines begins from the end of current line. After showing the line it disappears. The static code looks like this:
for i in range(0, len(numberOfPoints)-1):
plt.clf()
x1 = xPoints[i]
x2 = XPoints[i+1]
y1 = yPoints[i]
y2 = yPoints[i+1]
plt.plot([x1,x2], [y1,y2])
How can I animate it?