manpagez: man pages & more
info mathgl_en
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4 Color scheme

The color scheme is used for determining the color of surfaces, isolines, isosurfaces and so on. The color scheme is defined by the string, which may contain several characters that are color id (see section Line styles) or characters ‘#:|’. Symbol ‘#’ switches to mesh drawing or to a wire plot. Symbol ‘|’ disables color interpolation in color scheme, which can be useful, for example, for sharp colors during matrix plotting. Symbol ‘:’ terminate the color scheme parsing. Following it, the user may put styles for the text, rotation axis for curves/isocontours, and so on. Color scheme may contain up to 32 color values.

The final color is a linear interpolation of color array. The color array is constructed from the string ids (including “bright” colors, see Color styles). The argument is the amplitude normalized between CminCmax (see Axis settings). For example, string containing 4 characters ‘bcyr’ corresponds to a colorbar from blue (lowest value) through cyan (next value) through yellow (next value) to the red (highest value). String ‘kw’ corresponds to a colorbar from black (lowest value) to white (highest value). String ‘m’ corresponds to a simple magenta color.

There are several useful combinations. String ‘kw’ corresponds to the simplest gray color scheme where higher values are brighter. String ‘wk’ presents the inverse gray color scheme where higher value is darker. Strings ‘kRryw’, ‘kGgw’, ‘kBbcw’ present the well-known hot, summer and winter color schemes. Strings ‘BbwrR’ and ‘bBkRr’ allow to view bi-color figure on white or black background, where negative values are blue and positive values are red. String ‘BbcyrR’ gives a color scheme similar to the well-known jet color scheme.

For more precise coloring, you can change default (equidistant) position of colors in color scheme. The format is ‘{CN,pos}’, ‘{CN,pos}’ or ‘{xRRGGBB,pos}’. The position value pos should be in range [0, 1]. Note, that alternative method for fine tuning of the color scheme is using the formula for coloring (see Curved coordinates).

Most popular color schemes.

When coloring by coordinate (used in map), the final color is determined by the position of the point in 3d space and is calculated from formula c=x*c[1] + y*c[2]. Here, c[1], c[2] are the first two elements of color array; x, y are normalized to axis range coordinates of the point.

Additionally, MathGL can apply mask to face filling at bitmap rendering. The kind of mask is specified by one of symbols ‘-+=;oOsS~<>jdD*^’ in color scheme. Mask can be rotated by arbitrary angle by command mask or by three predefined values +45, -45 and 90 degree by symbols ‘\/I’ correspondingly. Examples of predefined masks are shown on the figure below.

Example of masks for face coloring.

However, you can redefine mask for one symbol by specifying new matrix of size 8*8 as second argument for mask command. For example, the right-down subplot on the figure above is produced by code
gr->SetMask('+', "ff00182424f80000"); gr->Dens(a,"3+");


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on March 21, 2014 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.