How to make Manipulate run/play automatically after evaluation, i.e. without having to hit the play button (but still being able to use the pause/play button)?

Manipulate[ Plot[Sin[k x], {x, 0, 2 Pi}], {k, 0, 50, 1, Appearance -> "Open"}]

(No, I don't want to use Animate.)

  • $\begingroup$ {k, 0, 50, 1, ControlType -> Animator, Appearance -> "Open"} - help me find a duplicate. $\endgroup$ – Kuba Mar 26 '18 at 16:26
  • $\begingroup$ @Kuba I haven't found an explicit duplicat, hence decided to post this question. ControlType -> Animator works, but... it somehow overrides Appearance -> "Open" - i.e. it's closed, not open (v10.4 and v11.1, Linux). $\endgroup$ – corey979 Mar 26 '18 at 16:30
  • $\begingroup$ It is open for me though Animator does not have input field by default. What about {k, 0, 50, 1, ControlType -> Animator, Appearance -> "Open", AppearanceElements -> All}? $\endgroup$ – Kuba Mar 26 '18 at 16:32
  • $\begingroup$ @Kuba Ok, I wasn't clear - the buttons are indeed open, but with the input field lacking, I would need to somehow tweak the plot further to have the current k value visible. I hoped there might be something like Autoplay -> True... $\endgroup$ – corey979 Mar 26 '18 at 16:35

Unless I'm mistaken only Animator based controllers have AnimationRunning option. We can use it, but Animator does not have InputField appearance element. We can add it separately, but it will be tricky to hide it. So let's assume you don't have to:

  Plot[Sin[k x], {x, 0, 2 Pi}]
, {k, 0, 50, 1, ControlType -> Animator}
, {{k, 0, ""}, 0, 50, 1, ControlType -> InputField}

enter image description here

  • $\begingroup$ Thanks! And adding FieldSize -> 5 after the InputField makes it look like the default. $\endgroup$ – corey979 Mar 26 '18 at 16:55

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.