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

34

gnuplot 4.6

For many terminal types it is also possible to assign user-de ned colors using explicit rgb (red, green, blue) values, named colors, or color values that refer to the current pm3d palette.

Examples:

 

plot sin(x) lt rgb "violet"

# one of gnuplot's named colors

plot sin(x) lt rgb "#FF00FF"

# explicit RGB triple in hexadecimal

plot sin(x) lt palette cb -45

# whatever color corresponds to -45

 

# in the current cbrange of the palette

plot sin(x) lt palette frac 0.3

# fractional value along the palette

See show colornames (p. 104), set palette (p. 137), cbrange (p. 167).

For terminals that support dot/dash patterns, each default linetype has both a dot-dash pattern and a default color. Gnuplot does not currently provide a mechanism for changing the dot-dash pattern, so if you want both a particular dash pattern and a particular color you must rst choose a linetype that has the required dash pattern, then override the default color using the keyword linecolor, abbreviated lc. For example, the postscript terminal provides a dashed blue line as linetype 3. The plot commands below use this same dash pattern for three plots, one in blue (the default), another in red (the default for linetype 1), and a third in gold.

Example:

set term postscript dashed color

plot 'foo' lt 3, 'baz' lt 3 linecolor 1, 'bar' lt 3 lc rgb 'gold'

Colorspec

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

Syntax:

... {linecolor | lc} {<colorspec> | <n>}

... {textcolor | tc} {<colorspec> | {linetype | lt} <n>}

where <colorspec> has one of the following forms:

rgbcolor "colorname"

 

rgbcolor "#RRGGBB"

 

rgbcolor variable

# color is read from input file

palette frac <val>

# <val> runs from 0 to 1

palette cb <value>

# <val> lies within cbrange

palette z

 

variable

# color index is read from input file

The "<n>" is the linetype number the color of which is used, see test (p. 172).

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

"#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 << 16) + (0 << 8) + (255).

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 e ect. 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. 167). See also set colorbox (p. 104). 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. It also allows coloring 2D plots by palette values read from an extra column of data (not all 2D plot styles allow an extra column).

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