3
$\begingroup$

I have a complex manipulate interface with many controls that draws a rather complex graphics (more specifically, several graphics composed and displayed in a TabView). How can I export a video of only the graphics (without the controls) when varying one specific slider? I experimented with different options but all are unsatisfactory so far. In general, when I export manipulate, the image quality is low, even when I increase resolution. I obtained the best visual results with a screen capture (using Quicktime on Mac), but this is not convenient, and also has the problem that the framerate is bad (the graphics renders rather slowly).

As a side remark, when I right click on the graphic and try to export it, the exported image shows errors (as in red regions, as if some commands couldn't execute)

Is there a way to just export the frames (for only the graphics) in screen quality to a file, while animating a specific slider?

$\endgroup$

1 Answer 1

2
$\begingroup$

You have a couple of options

1) Add the the following options to your Manipulate

Bookmarks->{"1":>{var1=valInitial, var2=val2,...},"2":>{var1=valFinal,var2=val2,...}}, 
InterpolationOrder->1

where var1 is the name of the variable you wish to move between valInitial and valFinal and var2,... are the variables to hold constant. If you add "ControlAppearance"->None in your Export, you'll get what you want.

2) Replace the Manipulate by Table, at least for the one variable you're interested in. You'll need to do some fancy variable injection using With, and then you'll need to map Setting across the list to remove the controls. Here is an example. Notice how I'm initiallizing a to aInit, which is 1.5.

Setting /@ Table[
   With[{aInit = 1.5, tMax = tm}, 
       Manipulate[Plot[Sin[a t], {t, 0, tMax}], {{a, aInit}, 1, 2}]
   ],
   {tm, 1, 10}
]

This is now a list of graphics which you can export to your hearts content. I sometimes do this if I have a very complicate graphics and I want to do the export one frame at a time.

About your pinking in Export, that's probably a dynamic timeout during evaluation. Write Style[Manipulate[...],DynamicEvaluationTimeout -> 60] (or whatever number you wish to use, in seconds) to do the export.

$\endgroup$
4
  • $\begingroup$ Glad to read it. I have been wondering for a couple of days why there were red error boxes in some of the frames I exported from a Manipulate that ran in fact with no errors. $\endgroup$
    – User18
    Commented Sep 12, 2017 at 3:25
  • $\begingroup$ Part 1) of this answer looks puzzling. How is it used? $\endgroup$
    – User18
    Commented Sep 12, 2017 at 4:33
  • $\begingroup$ Because of this line in the documentation for QuickTime export: "If bookmarks are set in the Manipulate object, Export will create a QuickTime file by interpolating between the bookmarks while preserving the speed and duration of the Manipulate." $\endgroup$ Commented Sep 12, 2017 at 18:02
  • $\begingroup$ Thanky you! Now I understand it completely. $\endgroup$
    – User18
    Commented Sep 14, 2017 at 18:21

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.