next up previous contents index
Next: Mouse input Up: Linetype, colors, and styles Previous: Linetype, colors, and styles   Contents   Index


Colorspec

Many commands allow you to specify a linetype with an explicit color. This option is only possible for terminals that support RGB color or pm3d palettes.

Syntax:


     ... {linetype | lt} <colorspec>

where 5#5colorspec6#6 has one of the following forms:


     rgbcolor "colorname"
     rgbcolor "#RRGGBB"
     rgbcolor variable
     palette frac <val>      # <val> runs from 0 to 1
     palette cb <value>      # <val> lies within cbrange
     palette z

"colorname" refers to one of the color names built in to gnuplot. For a list of the available names, see show palette colornames (p. [*]).

"#RRGGBB" is a hexadecimal constant preceded by the "#" symbol. The RRGGBB represents the red, green, and blue components of the color, each on a scale from 0 - 255. For example, magenta = full-scale red + full-scale blue would be represented by #FF00FF, which is the hexadecimal representation of (255 5#55#5 16) + (0 5#55#5 8) + (255).

"rgb variable" requires an additional column in the using specifier, and is only available in 3D plotting mode (splot). The extra column is interpreted as a 24-bit packed RGB triple. These are most easily specified in a data file as hexidecimal values (see above).

Example:


     rgb(r,g,b) = 65536 * int(r) + 256 * int(g) + int(b)
     splot "data" using 1:2:3:(rgb($1,$2,$3)) with points lc rgb variable

The color palette is a linear gradient of colors that smoothly maps a single numerical value onto a particular color. Two such mappings are always in effect. palette frac maps a fractional value between 0 and 1 onto the full range of the color palette. palette cb maps the range of the color axis onto the same palette. See set cbrange (p. [*]). See also set colorbox (p. [*]). You can use either of these to select a constant color from the current palette.

"palette z" maps the z value of each plot segment or plot element into the cbrange mapping of the palette. This allows smoothly-varying color along a 3d line or surface. This option applies only to 3D plots (splot).


next up previous contents index
Next: Mouse input Up: Linetype, colors, and styles Previous: Linetype, colors, and styles   Contents   Index
Ethan Merritt 2007-03-03