0
$\begingroup$

I am making an instructional program in which a random number appears and moves across and down into the appropriate bin, landing on top of the existing stack. Then another number appears, repeating the animation sequence until it lands on top of its own stack. When any stack reaches the top, the animation stops and this example of the distribution can be observed.

Thus,I wish to combine a sequence of animations, using the output of one to serve as the background to the next. How can I save the final graph of each Animate sequence so as to use it for the input of the next? The fact that animations are examples of Manipulate complicates matters. Do loops, etc. do not work here.

$\endgroup$
1
$\begingroup$

I'm not sure if this is actually what you want, but I think this might be an approach:

Manipulate[temp = {Green, Disk[{5, 0}, {3, 1}]};
Animate[
plot = Plot[Sin[x + a], {x, 0, 10}, Prolog -> temp], {a, 0, 5}, 
AnimationRunning -> True], 
Button["Snapshot", 
temp = {Texture[Rasterize[plot]], 
Polygon[{Scaled[{0, 0}], Scaled[{1, 0}], Scaled[{1, 1}], 
Scaled[{0, 1}]}, 
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]]

enter image description here

| improve this answer | |
$\endgroup$

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.