Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create animation of some discrete process using Manipilate:

Manipulate[**Some graphics based on very slow computations, each step is calculated slowly then the previous**], {Step, 1, 1000, 1}]

It works fine if I move Step slider with the mouse.

But if I click the 'Play' button, animation starts but a lot of steps are missing. For example, I see the picture corresponding the 1st step, then the 13th, then 51st... And sometimes I even get '$Aborted'.

Manipulate options like ContinuousAction -> False don't make any change.

How can I make Manupulate display all the steps, one by one, with "Play' button?

share|improve this question
Short way should be to adjust AnimationRate: {step, 1, 1000, 1, AnimationRate -> 1, Appearance -> "Open"}] – Kuba Jan 15 '14 at 9:53
But as I said computation time is different for each step, so it's impossible to find proper constant AnimationRate. – Epik17 Jan 15 '14 at 10:02
Better use Animate here and let it calculate all steps in advance – Sjoerd C. de Vries Jan 15 '14 at 10:44
@SjoerdC.deVries Thanks, it will work for sure, but in this case we need a lot of memory to store each step data :( – Epik17 Jan 15 '14 at 11:40
Converting the graphics to a bitmap may help if the number of graphical objects is high. – Sjoerd C. de Vries Jan 15 '14 at 11:47
up vote 1 down vote accepted

You are looking for the option DisplayAllSteps -> True in Animate:

(* plot with a random lag *)
plot[r_] := (Pause[RandomReal[]]; Plot[Sinc[r/10 x], {x, 0, 10}])

Animate[plot[z], {z, 1, 50, 1}, DisplayAllSteps -> True]

This code fails with an $Aborted if the rendering takes more than five seconds, because of the default Dynamic timeout. Michael explained how to use DynamicEvaluationTimeout to solve this as follows:

(* plot with a longer lag *)
plot[r_] := (Pause[6]; Plot[Sinc[r/10 x], {x, 0, 10}]);

  Animate[plot[z], {z, 1, 50, 1}, DisplayAllSteps -> True],
  DynamicEvaluationTimeout -> 100
share|improve this answer
In this case I get $Aborted when Step is rather big. The problem was discussed here!topic/comp.soft-sys.math.mathematica/… – Epik17 Jan 15 '14 at 11:50
@Epik17 I believe that only happens when the rendering lag is quite high; if it is that high this won't really count as an "animation" at that point. Nevertheless there should be a work-around for that; let me see if I can find it. – Mr.Wizard Jan 15 '14 at 11:56
I will be grateful if you find it. – Epik17 Jan 15 '14 at 12:03
FYI: It's there in V7, perhaps:… – Michael E2 Jan 15 '14 at 12:17
Feel free to incorporate it. DisplayAllSteps is your contribution. I've got to take my daughter to school now and start my day. I'll think about other ways. – Michael E2 Jan 15 '14 at 12:40

Your Answer


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.