As already mentioned, variables may be used to clarify the logical structure of a figure. The way the inscribed rectangle figure was implemented makes it easy to change the width of the rectangle. When a figure is complicated, judicious use of variables makes the figure flexible. The sample file depicting upper rectangles for the sin function is an example; to change the number of rectangles, one need change only a single number in the preamble. To change the integrand to a different increasing function also requires just one change in the preamble. (Labels' text must still be changed individually.)
If a figure depends suitably upon a collection of parameters, then a
loop can be used to draw the entire figure for multiple values of the
parameters, yielding successive ``snapshots'' of the figure as time
progresses.4 In the
sample files is a simple example, the cycloids traced by a rolling
wheel. Other possibilities are to solve a planar ODE for varying
lengths of time (illustrating the flow), or to plot solutions of a
-dimensional PDE (for example, to depict heat flow or wave
motion).