4
$\begingroup$

I have two pieces of code that work.

The first produces a list plot:

f[t_] := 10 + 25 t + 20 t^2;
x = Range[0, 10, 1];
y = f[x];
coord = {x[[#]], y[[#]]} & /@ Range[Length[x]];
ListPlot[coord, PlotMarkers -> {Automatic, 20}];

enter image description here

The second generates an animation:

SetDirectory["C:\Users\Leandro\Desktop"];
CreateDirectory["Pasta com imagens para GIF"];
SetDirectory["Pasta com imagens para GIF"];
plots = Table[Plot[Sin[x + a], {x, 0, Pi},PlotRange -> {{0, Pi}, {-1.1, 1.1}}], {a, 0, Pi, .1}];
Export["plot001.png", plots, "VideoFrames"];
FileNames[]

enter image description here

How can I combine these two pieces of code to create an animation in which the points of the list plot are appear progressively?

$\endgroup$
2
  • $\begingroup$ What do you want to change gradually? The position of the points? The appearance of the points? $\endgroup$
    – mikado
    Jun 22, 2016 at 21:22
  • $\begingroup$ Do you want to plot this graph but rise each point's y values? Can you explain it more explicitly? $\endgroup$
    – Wjx
    Jun 22, 2016 at 21:58

1 Answer 1

4
$\begingroup$

You may do this by Plotting multiple figures and show them one by one via using Manipulate, Animate or Dynamic.

Animate[
  ListPlot[coord[[;; t]], 
           PlotMarkers -> {Automatic, 20},  
           PlotRange -> {{0, 10}, {0, 3000}}], {t, 1, Length@coord, 1}]

Mathematica graphics

or

Dynamic[
  With[{t = Clock[{1, Length[coord], 1}]}, 
  ListPlot[coord[[;; t]], 
           PlotMarkers -> {Automatic, 20},  
           PlotRange -> {{0, 10}, {0, 3000}}]
  ]
]

enter image description here

$\endgroup$
0

Your Answer

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

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