GETCOLORMAP

Purpose:

Returns the colormap for density and shaded plots.

Syntax:

GETCOLORMAP(win, mode)

win

-

Optional. A Window containing the input image. Defaults to the system colormap.

mode

-

Optional. An integer. The image source values.

0:

return colormap values directly from displayed bitmap (default).

1:

return colormap values from underlying series data.

Returns:

An Nx3 array of reals ranging from 0.0 to 1.0. N is the number of values for each red, green and blue component.

 

(r, g, b) = getcolormap(win) returns separate red, green and blue components in three NxM arrays where NxM is the size of the input image.

Example:

all = (0..255)/255

zip = zeros(255, 1);

 

map = ravel(all, zip, all);

 

setcolormap(map);showcmap();

 

creates and displays a black to magenta colormap.

 

cmap = getcolormap;

cmap == map returns all ones.

Example:

W1: spline2(rand(10), 3);setplottype(3);rainbow

(r, g, b) = getcolormap(w1)

 

W1 contains a 28x28 random image, The returned r, g and b variables are 28x28 matrices containing the red, green and blue components scaled from 0.0 to 1.0.

Remarks:

The colormap is an array of N rows by 3 columns where 1 <= N <= 255. Each individual RGB (red, green, blue) value is a real number ranging from 0 to 1.0.

 

A window must be specified to use the optional mode argument.

 

If mode is 0, the colormap is derived from the displayed bitmap image, else the colormap is derived from the series data. In general, the difference is negligible.

 

The following built-in colormaps are available:

 

AUTUMN

Red, orange, yellow colormap

BONE

Blue tinted gray scale colormap

CIVIDIS

Blue, green, yellow colormap

COOL

Shades of blue

COPPER

Shades of copper colormap

FLAG

Repeating red, orange, yellow, green, blue, violet colormap.

GOULDIAN

Blue, green, yellow colormap

GRAY

Black & white colormap

HOT

Black, red, yellow, white colormap

HSV

Red, yellow, green, cyan, blue, magenta, red colormap

INFERNO

Magenta, red, yellow colormap

MAGMA

Magenta, red, yellow colormap

PARULINE

Blue, green, yellow, orange colormap

PINK

Black, red, yellow, white light colormap

PLASMA

Magenta, red, yellow colormap

PRISM

Repeating red, orange, yellow, green, blue, violet colormap.

RAINBOW

Visible color spectrum colormap

SPRING

Magenta, pink, yellow colormap

SUMMER

Green to yellow colormap

TURBO

Red, blue, green, yellow colormap

VIRIDIS

Blue, green, yellow colormap

WINTER

Blue to green colormap

See Also:

COOL

COPPER

DEFCOLOR

GETRGB

GRAY

HOT

RAINBOW

SETCOLORMAP

SHOWCMAP