Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pmi432 / LR02 / Books / gnuplot 4.6 manual.pdf
Скачиваний:
59
Добавлен:
18.03.2015
Размер:
2.22 Mб
Скачать

gnuplot 4.6

141

File

set palette le is basically a set palette de ned (<gradient>) where <gradient> is read from a data le. Either 4 columns (gray,R,G,B) or just three columns (R,G,B) have to be selected via the using data le modi er. In the three column case, the line number will be used as gray. The gray range is automatically rescaled to [0,1]. The le is read as a normal data le, so all data le modi ers can be used. Please note, that R might actually be e.g. H if HSV color space is selected.

As usual < lename> may be '-' which means that the data follow the command inline and are terminated by a single e on a line of its own.

Use show palette gradient to display the gradient.

Examples:

Read in a palette of RGB triples each in range [0,255]:

set palette file 'some-palette' using ($1/255):($2/255):($3/255)

Equidistant rainbow (blue-green-yellow-red) palette:

set palette model RGB file "-" 0 0 1 0 1 0 1 1 0 1 0 0

e

Binary palette les are supported as well, see binary general (p. 73). Example: put 64 triplets of R,G,B doubles into le palette.bin and load it by

set palette file "palette.bin" binary record=64 using 1:2:3

Gamma correction

For gray mappings gamma correction can be turned on by set palette gamma <gamma>. <gamma> defaults to 1.5 which is quite suitable for most terminals.

The gamma correction is applied to the cubehelix color palette family, but not to other palette coloring schemes. However, you may easily implement gamma correction for explicit color functions.

Example:

set palette model RGB

set palette functions gray**0.64, gray**0.67, gray**0.70

To use gamma correction with interpolated gradients specify intermediate gray values with appropriate colors. Instead of

set palette defined ( 0 0 0 0, 1 1 1 1 )

use e.g.

set palette defined ( 0 0 0 0, 0.5 .73 .73 .73, 1 1 1 1 )

or even more intermediate points until the linear interpolation ts the "gamma corrected" interpolation well enough.

Postscript

In order to reduce the size of postscript les, the gray value and not all three calculated r,g,b values are written to the le. Therefore the analytical formulae are coded directly in the postscript language as a header just before the pm3d drawing, see /g and /cF de nitions. Usually, it makes sense to write therein de nitions of only the 3 formulae used. But for multiplot or any other reason you may want to manually edit the transformations directly in the postscript le. This is the default option nops allcF. Using the option

Соседние файлы в папке Books