This is documentation for Mathematica 4, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Wolfram Research, Inc.

Some Special PlotsSound

1.9.12 Special Topic: Animated Graphics

On many computer systems, Mathematica can produce not only static images, but also animated graphics or "movies".

The basic idea in all cases is to generate a sequence of "frames" which can be displayed in rapid succession. You can use the standard Mathematica graphics functions described above to produce each frame. The mechanism for displaying the frames as a movie depends on the Mathematica interface you are using. With a notebook-based interface, you typically put the frames in a sequence of cells, then select the cells and choose a command to animate them. With text-based interfaces, there is often an external program provided for displaying animated graphics. The program can typically be accessed from inside Mathematica using the function Animate.

Typical ways to produce animated graphics.

When you produce a sequence of frames for a movie, it is important that different frames be consistent. Thus, for example, you should typically give an explicit setting for the PlotRange option, rather than using the default Automatic setting, in order to ensure that the scales used in different frames are the same. If you have three-dimensional graphics with different view points, you should similarly set SphericalRegion -> True in order to ensure that the scaling of different plots is the same.

This generates a list of graphics objects. Setting DisplayFunction -> Identity stops Plot3D from rendering the graphics it produces. Explicitly setting PlotRange ensures that the scale is the same in each piece of graphics.

In[1]:= Table[ Plot3D[ BesselJ[0, Sqrt[x^2 + y^2] + t],

{x, -10, 10}, {y, -10, 10}, Axes -> False,

PlotRange -> {-0.5, 1.0},

DisplayFunction -> Identity ],

{t, 0, 8} ] // Short


On an appropriate computer system, ShowAnimation[%] would animate the graphics. This partitions the graphics into three rows, and shows the resulting array of images.

In[2]:= Show[ GraphicsArray[ Partition[%, 3] ] ]


Some Special PlotsSound