# Random walk reflection principle diagram #1 walk <- c(0,1,2,1,2,3,4,5,6,5,4,3,4,3) n <- length(walk)-1 t <- 0:n # Plot the walk plot(t, walk, ylab="position", xlab="time", type="l") # Horizontal axis for the parameter a haxis <- (-20:40*n)/40 points(haxis, rep(5,length(haxis)), pch=".") text(0, 5, labels="a", pos=3) # Vertical axis for the parameter x vaxis <- (-20:300*n)/40 points(rep(n ,length(vaxis)), vaxis, pch=".") text(n, 3, labels="x", pos=2)