]>
Before leaving the ribbon example, we make two improvements. Normally, the color given to each point in the space is a function of its height within a bounding box. The points at the bottom of the box are red, those at the top are purple.
To change the normal coloring, you can give an option . When Axiom goes about displaying the data, it determines the range of colors used for all points within the box. Axiom then distributes these numbers uniformly over the number of hues. Here we use the simple color function for the -th ribbon.
Also, we add an argument so you can give the range of occupied by the ribbons. For example, if the is given as and there are ribbons to be displayed, each ribbon would have width and would appear in the range .
Refer to lines 4-9. Line 4 assigns to the variable part of the (after all, it need not be ). Suppose that is given as where and have numerical values. Then line 5 assigns the value of to the variable . Line 6 computes the width of the ribbon by dividing the difference of and by the number, , of ribbons. The result is assigned to the variable . Note that in the for-loop in line 7, we are iterating in parallel; it is not a nested loop.