8.1.1 The palette
Wherever Pyxplot takes a color as an input to a command, the user has three options for how it may be specified. A selection of widely-used colors may be specified by name, for example red and blue. A complete list of such colors may be found in Section 19.4. Alternatively, an object of type color may be provided, such as rgb(0,1,0), hsb(0.5,0.5,0.5), gray(0.2), colors.green + colors.red, or colors.yellow - colors.green.
The third option is to specify a numbered color from Pyxplot’s palette. By default, this contains a series of visually distinctive colors which are, insofar as possible, also distinctive to users with most common forms of color blindness:
The first color is number 1, the second number 2, and so forth. As well as being accessible by number, these colors also form the default series which Pyxplot chooses for successive datasets when their colors are not individually specified.
set palette brickRed, limeGreen, cadetBlue
The palette is treated as a cyclic list, and so in the above example, color number 4 would map to brickRed, as would color numbers 1 and 8. The default palette which Pyxplot uses on startup may be changed by setting up a configuration file, as described in Chapter 19.
If a non-integer color is requested from the palette, for example color 1.5, then a color is returned which is half-way in between colors 1 and 2 in RGB space; in this case, brown. This can be used to produce custom color gradients, as the following example demonstrates (the colormap plot style will be described in Section 8.12):