I am trying to animate the y axis moving along the x axis while keeping it the same height the entire time. This works after a certain point, but the first couple of seconds the y axis scale gets larger, stretching the graph.
In making this animation, I noticed that it automatically centers the plot. Is there a way to align the y axis with the left side of the frame (so that it looks like the x axis is sliding to the left)? This probably just comes down to specifying the size of the frame ahead of time, but I'm not sure how to do this.
Also, if you know how to get the red disk to keep from shrinking, that would be great but is not a priority.
Here's the code I have so far:
frame[t0_] := Show[Plot[f[t], {t, t0, 8}, AxesLabel -> {"t (s)","x (m)"}, AxesStyle -> Large, PlotRange -> {{t0 - 0.2, 8.2}, {-3, 5}}, AspectRatio -> 8/(8 - t0), Ticks -> {{0, 2, 4, 6, 8}, {-2, 0, 2, 4}}, ImageSize -> Medium], Graphics[{AspectRatio -> 1, Red, Disk[{t0, f[t0]}, 0.2]}]];
frames = Table[frame[t0], {t0, 0, 7.9, 0.1}];
Export["animation.gif", frames]