0
$\begingroup$

Hi I have a question on how can I create an animated 2 points (dot) that move across the n number of the data point, as shown in my 2D graph?

[![ListLinePlot\[{EncoderDeltaL, VoltageDeltaL}, 
 PlotRange -> {-0.2, 2.5}, PlotLegends -> {"Mean Encoder", "Sensor"}, 
 AxesLabel -> {"n", " \[CapitalDelta\]L(cm)"}, 
 PlotLabel -> "Mean 60\[Degree\]"\]][1]]
$\endgroup$
1
  • 1
    $\begingroup$ It would be a good idea if you also post the lists you want to plot, such that we can see the plot. Also necessary to indicate (or at least to describe in details) which points should move and how? $\endgroup$ Oct 8, 2019 at 8:08

1 Answer 1

3
$\begingroup$

The simplest way is following:

series = Table[{x, Sin[x]^2}, {x, 0, 2 \[Pi], \[Pi]/18}];
an = Table[
   ListLinePlot[series,
    PlotMarkers -> Automatic, ImageSize -> 400,
    Epilog -> {Red, PointSize[Large], Point[series[[i]]] }]
   , {i, 1, Length@series}];

Export["d:\\tmp\\anum.gif", an, "DisplayDurations" -> 1/6]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you, let me give it a try! $\endgroup$
    – Boajj04
    Oct 8, 2019 at 9:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.