GNUPlot Manual
GNUPlot Manual
GNUPlot Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
36 SET-SHOW gnuplot 4.0 87<br />
36.49.2 Defined<br />
Gray-to-rgb mapping can be manually set by use of defined: A color gradient is defined and used to<br />
give the rgb values. Such a gradient is a piecewise linear mapping from gray values in [0,1] to the RGB<br />
space [0,1]x[0,1]x[0,1]. You have to specify the gray values and the corresponding RGB values in between<br />
a linear interpolation shall take place:<br />
Syntax:<br />
set palette defined { ( {, }... ) }<br />
are gray values which are mapped to [0,1] and are the corresponding rgb colors.<br />
The color can be specified in three different ways:<br />
:= { | ’’ | ’#rrggbb’ }<br />
Either by three numbers (each in [0,1]) for red, green and blue, separated by whitespace, or the name<br />
of the color in quotes or X style color specifiers also in quotes. You may freely mix the three types in a<br />
gradient definition, but the named color "red" will be something strange if RGB is not selected as color<br />
space. Use show palette colornames for a list of known color names.<br />
Please note, that even if written as , this might actually be the component in HSV color space<br />
or in CIE-XYZ space, or ... depending on the selected color model.<br />
The values have to form an ascending sequence of real numbers; the sequence will be automatically<br />
rescaled to [0,1].<br />
set palette defined (without a gradient definition in braces) switches to RGB color space and uses a<br />
preset full-spectrum color gradient. Use show palette gradient to display the gradient.<br />
Examples:<br />
To produce a gray palette (useless but instructive) use:<br />
set palette model RGB<br />
set palette defined ( 0 "black", 1 "white" )<br />
To produce a blue yellow red palette use (all equivalent):<br />
set palette defined ( 0 "blue", 1 "yellow", 2 "red" )<br />
set palette defined ( 0 0 0 1, 1 1 1 0, 2 1 0 0 )<br />
set palette defined ( 0 "#0000ff", 1 "#ffff00", 2 "ff0000" )<br />
To produce some rainbow-like palette use:<br />
set palette defined ( 0 "blue", 3 "green", 6 "yellow", 10 "red" )<br />
Full color spectrum within HSV color space:<br />
set palette model HSV<br />
set palette defined ( 0 0 1 1, 1 1 1 1 )<br />
set palette defined ( 0 0 1 0, 1 0 1 1, 6 0.8333 1 1, 7 0.8333 0 1)<br />
To produce a palette with few colors only use:<br />
set palette model RGB maxcolors 4<br />
set palette defined ( 0 "blue", 1 "green", 2 "yellow", 3 "red" )<br />
’Traffic light’ palette (non-smooth color jumps at gray = 1/3 and 2/3).<br />
set palette model RGB<br />
set palette defined (0 "dark-green", 1 "green", 1 "yellow", \<br />
2 "dark-yellow", 2 "red", 3 "dark-red" )<br />
36.49.3 Functions<br />
Use set palette functions , , to define three formulae for the R(gray),<br />
G(gray) and B(gray) mapping. The three formulae may depend on the variable gray which will take