I have a sequence of 2D-points from uniformly sampling a time dependent process and plot this sequence with ListLinePlot
. For example:
data = Table[{Sin[x], x Cos[x]}, {x, 0, Pi, Pi/10}];
ListLinePlot[data, InterpolationOrder -> 2, Epilog -> Point@data]
I would like to animate the interpolated curve smoothly as a function of time. Here is what I tried:
i[t_] := {ListInterpolation[data[[All, 1]]][t],
ListInterpolation[data[[All, 2]]][t]}
frames = Table[
ListLinePlot[Join[data[[1 ;; Floor@s]], {i[s]}],
InterpolationOrder -> 2, Axes -> None, ImageSize -> 400,
AspectRatio -> 1, PlotRange -> {{0, 1.2}, {-3, 1}},
Frame -> True]
,{s, 2, 10, 0.2}];
The obvious problem with this approach is that the curve warps a lot in regions of high curvature. Ideally I would like the animation to perfectly coincide with the full plot at any timestep. Any ideas?