0
$\begingroup$

Lets say I have a very simple manipulate in Mathematica given by:

Manipulate[Plot[Sin[a x],{x,-2 Pi,2 Pi}],{a,0,5}]

I want two things which I am unable to do:

  1. I want an animation of the following plot with a being displayed on the plot like a = 'value'

  2. I want to export only the animation with the value of a displayed on it as a movie file. I do not want the slider or anything.

Please suggest. Thanks

$\endgroup$

1 Answer 1

3
$\begingroup$
Manipulate[Plot[Sin[a x], {x, -2 Pi, 2 Pi}, PlotLabel -> Row[{"a=", a}]], {a, 0, 5}]

Mathematica graphics

For exporting, there are many posts on exporting Manipulate to animations/movies. Please see this for example

Export animation of a Manipulate autorun sequence?

If the above still does not answer you, then you can follow up.

ps. You can always just export like this (no need for manipulate)

SetDirectory[NotebookDirectory[]];
tbl = Table[ Plot[Sin[a x], {x, -2 Pi, 2 Pi}, 
     PlotLabel -> Row[{"a=", a}]], {a, 0, 5, .1}];
Export["movie.mov", tbl]

Mathematica graphics

$\endgroup$
3
  • $\begingroup$ You beat me by seconds. My take: Manipulate[ Plot[Sin[a x], {x, -2 Pi, 2 Pi}, Epilog -> Inset[Framed[Style["a =" <> ToString[a], 20], Background -> LightYellow], {Right, Bottom}, {Right, Bottom}]], {a, 0, 5}] $\endgroup$
    – Hector
    Nov 9, 2014 at 8:53
  • $\begingroup$ @Hector Your plot likes nicer with use of Inset. $\endgroup$
    – Nasser
    Nov 9, 2014 at 8:57
  • $\begingroup$ @Nasser and Hector Thanks for your help. This solves my problem!! $\endgroup$
    – Brato
    Nov 9, 2014 at 9:00

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.