Credits Overview Plotting Styles Commands Terminals

colorspec

Many commands allow you to specify a linetype with an explicit color.

Syntax:

      ... {linecolor | lc} {"colorname" | <colorspec> | <n>}
      ... {textcolor | tc} {<colorspec> | {linetype | lt} <n>}
      ... {fillcolor | fc} {<colorspec> | linetype <n> | linestyle <n>}

where <colorspec> has one of the following forms:

      rgbcolor "colorname"    # e.g. "blue"
      rgbcolor "0xRRGGBB"     # string containing hexadecimal constant
      rgbcolor "0xAARRGGBB"   # string containing hexadecimal constant
      rgbcolor "#RRGGBB"      # string containing hexadecimal in x11 format
      rgbcolor "#AARRGGBB"    # string containing hexadecimal in x11 format
      rgbcolor <integer val>  # integer value representing AARRGGBB
      rgbcolor variable       # integer value is read from input file
      palette frac <val>      # <val> runs from 0 to 1
      palette cb <value>      # <val> lies within cbrange
      palette z
      palette <colormap>      # use named colormap rather than current palette
      variable                # color index is read from input file
      bgnd                    # background color
      black

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

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

Hexadecimal constants can be given in quotes as "#RRGGBB" or "0xRRGGBB", where RRGGBB represents the red, green, and blue components of the color and must be between 00 and FF. For example, magenta = full-scale red + full-scale blue could be represented by "0xFF00FF", which is the hexadecimal representation of (255 << 16) + (0 << 8) + (255).

"#AARRGGBB" represents an RGB color with an alpha channel (transparency) value in the high bits. An alpha value of 0 represents a fully opaque color; i.e., "#00RRGGBB" is the same as "#RRGGBB". An alpha value of 255 (FF) represents full transparency.

For a callable function that converts any of these forms to a 32bit integer representation of the color, see expressions functions rgbcolor.

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. See also set colorbox. 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). There are two special color specifiers: bgnd for background color and black.

Subtopics