2
$\begingroup$

I have a data set of the format below

{time,x_pos,y_pos,z_pos}

I would like to do an animation showing the coordinate {x,y,z} changes over time in 3D list point plot. Could anyone please give me an idea? The final animation should look as the following. The indicator (green circle) is moving with the time (shown above the figure). I am sorry that I could not share the data. Thank you! enter image description here

$\endgroup$
3
$\begingroup$
SeedRandom[1]
dates = Sort @ RandomSample[DateRange[Today, DatePlus[Today, {100, "Day"}]], 30];
data = Join[List /@ dates, Accumulate[RandomReal[10, {30, 3}]], 2];

g1 = Graphics3D[{Blue, Line@data[[All, 2 ;;]]}, BoxRatios -> 1, Axes -> Automatic];

frames = Table[Show[g1, Graphics3D[{Red, Sphere[data[[i, 2 ;;]], 5]}], 
    PlotLabel -> data[[i, 1]], SphericalRegion -> True, 
    ImageSize -> Medium, ImagePadding -> 20, 
    PlotRange -> {{0, 200}, {0, 200}, {0, 200}}], 
  {i, 1, Length @ data}];

ListAnimate[frames]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you very much! I used your code as template and generate my own version. $\endgroup$
    – Bemtevi77
    Sep 19 '20 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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