A Tutorial for Creating Movies from Graphs of Data
|
IntroductionThis tutorial briefly demonstrates tools for making movies of graphed data, as might be needed to show how data change with time. Before getting into details, it will help to have an example of a completed movie: Below is an example of one of the images that made up a single frame of the above movie (the 21st frame, to be exact):
The Python script that produced the movie and its constituent frames:
|
RequirementsTo create movies from graphed data as in this tutorial, you will need the following software, all of which are open source projects available for many different hardware platforms and operating systems:
|
InstructionsRead throughGraphMovieDemo.py. This is the Python
script essentially performs three tasks. First, it creates some data to
use as an example. The arrays x and y store the
data. The array x is a 1-by-1000 array of equally
spaced 64-bit floating point numbers that represent the the x-axis. The
array y is a 100-by-1000 array. Each of the 100 rows of
y represent a snapshot of a function at a point in time.
Once these arrays have been created, the script goes on to plot each row
of y as a function of x. Each of the these
graphs is saved as a separate image in the directory the script is
located. Finally, the script calls upon MEncoder to piece all the images
in the directory together into an AVI movie called
output.avi. More detailed comments as to what the script is
doing are included in the script itself.
|
End MatterThanks to James McBride for help with MEncoder. This tutorial was created on 2004 August 15. |