How to | Create Animations

Animations can convey much more information than static displays. The built-in Wolfram Language functions Animate and ListAnimate provide an immediate way to construct animations of graphics or any other kind of expression in a Wolfram System notebook. There are many other ways to interact with animations, including using interface-building tools like Manipulate and Dynamic, or file manipulation tools like Import and Export.

Use Animate to animate a picture of for changing values of :

The Wolfram Language can animate any expression, not just graphics. Here, Animate scans through integer powers of a polynomial. The DefaultDuration option specifies how long the animation should take from start to finish, in seconds:

    

Use ListAnimate to animate a list of objects. Setting the AnimationRunning option to False prevents the animation from starting automatically:

    

For continuous ranges, Manipulate includes animation controls, which are hidden by default. Show them automatically by setting the Appearance option to "Open". Notice that you can animate multiple variables at once:

    

Pass a list of graphics or any other expression to Export to create an animation in an "SWF", "AVI", "TIFF", or animated "GIF" file. Export will also create an animation instead of a list when given a Manipulate, Animate, or ListAnimate:

Import a "QuickTime", "AVI", "TIFF", or animated "GIF" file with "ImageList" to obtain a list of images in the animation:

Import just a single frame of the animation:

    

The Animator control can be used directly to dynamically control an animating variable, outside the structure of Animate or Manipulate:

A Dynamic that automatically changes itself is effectively a self-contained animation. DynamicModule localizes and stores the value of the variable counter:

The Clock function can also be used in Dynamic to drive a time-based animation. Here is a disk which changes color from Hue[0] to Hue[1] every 20 seconds:

  • Introduction to Manipulate
  • Introduction to Dynamic
  • How to: Build an Interactive Application
  • How to: Evaluate Expressions inside Dynamic or Manipulate
  • Animate  ListAnimate  Animator  AnimationRunning  DefaultDuration  Manipulate  Dynamic  DynamicModule  Appearance  Import  Export  "AVI"

  • Interactive Manipulation
  • Multimedia Formats
  • Control Objects
  • Dynamic Visualization
  • Options & Styling for Interactive Manipulation
  • "How to" Topics