How can I to plot a progressive walk from point to point?
Lets have p1 =[1,0], p2=[0,1], p3=[1,1]. Plot should first draw a line from p1 to p2 showing the direction, wait for a second, then draw another line from p2 to p3 and it goes on if you have more data.
The plot size should be first fixed to (0,1)^2. Correct output should look similar to this image: Example plot
My code is this for now:
plot(x,y,xlim=range(x), ylim=range(y), xlab="x", ylab="y", main="Filled Plane",pch=16)
#lines(x,y,xlim=range(x),ylim=(y),pch=16)
for(i in 1:20){
arrows(x[i],y[i],x[i+1],y[i+1],length = 0.25, angle = 30, col = 1:3)
}