Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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