colormaps is a library containing functions related to color maps. Color maps are tables of colors which can be used with the colormap function; they are used by functions such as image and surf to map values to colors.
All functions accept at least the number of colors n as input argument, and produce an n-by-3 real double array which can be used directly as the argument of colormap. The default value of n is 256.
colormaps defines the following functions:
Function | Description |
---|---|
black2orangecm | color shades from black to orange |
black2red2whitecm | color shades from black to red and white |
blue2greencm | color shades from blue to green |
blue2yellow2redcm | color shades from blue to yellow and red |
cyan2magentacm | color shades from cyan to magenta |
graycm | gray shades from black to white |
green2yellowcm | color shades from green to yellow |
huecm | color shades from red to red through green and blue |
interprgbcm | colormap created with linear interpolation |
magenta2yellowcm | color shades from magenta to yellow |
red2yellowcm | color shades from red to yellow |
sepiacm | sepia shades |
whitecm | plain white |
The following statement makes available functions defined in colormaps:
use colormaps
Functions are typically used directly as the argument of colormap:
colormap(blue2yellow2red);
Colormap with shades from black to orange.
use colormaps cm = black2orangecm cm = black2orangecm(n)
black2orangecm(n) creates a color map with n entries corresponding to color shades from black to orange. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with shades from black to red and white.
use colormaps cm = black2red2whitecm cm = black2red2whitecm(n)
black2red2whitecm(n) creates a color map with n entries corresponding to color shades from black to red and white. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with shades from blue to green.
use colormaps cm = blue2greencm cm = blue2greencm(n)
blue2greencm(n) creates a color map with n entries corresponding to color shades from blue to green. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with shades from blue to yellow and red.
use colormaps cm = blue2yellow2redcm cm = blue2yellow2redcm(n)
blue2yellow2redcm(n) creates a color map with n entries corresponding to color shades from blue to yellow and red. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with shades from cyan to magenta.
use colormaps cm = cyan2magentacm cm = cyan2magentacm(n)
cyan2magentacm(n) creates a color map with n entries corresponding to color shades from cyan to magenta. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with shades of gray.
use colormaps cm = graycm cm = graycm(n)
graycm(n) creates a color map with n entries corresponding to gray shades from black to white. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with shades from green to yellow.
use colormaps cm = green2yellowcm cm = green2yellowcm(n)
green2yellowcm(n) creates a color map with n entries corresponding to color shades from green to yellow. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with hue from red to red through green and blue.
use colormaps cm = huecm cm = huecm(n)
huecm(n) creates a color map with n entries corresponding to color shades with hue varying linearly from red back to red through green and blue. In HSV (hue-saturation-value) space, saturation and value are 1 (maximum). The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with entries obtained by linear interpolation.
use colormaps cm = interprgbcm(i, r, g, b) cm = interprgbcm(i, r, g, b, n)
interprgbcm(i,r,b,g,n) creates a color map with n entries. Color shades are interpolated between colors defined in RGB color space by corresponding elements of r, g and b, defined for input in i. These four arguments must be vectors of the same length larger or equal to 2 with elements between 0 and 1. Argument i must have monotonous entries with i(1)=0 and i(end)=1. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, magenta2yellowcm, red2yellowcm, sepiacm, whitecm
Colormap with shades from magenta to yellow.
use colormaps cm = magenta2yellowcm cm = magenta2yellowcm(n)
magenta2yellowcm(n) creates a color map with n entries corresponding to color shades from magenta to yellow. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, red2yellowcm, sepiacm, whitecm
Colormap with shades from red to yellow.
use colormaps cm = red2yellowcm cm = red2yellowcm(n)
red2yellowcm(n) creates a color map with n entries corresponding to color shades from red to yellow. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, sepiacm, whitecm
Colormap with shades of sepia.
use colormaps cm = sepiacm cm = sepiacm(n)
sepiacm(n) creates a color map with n entries corresponding to shades of sepia. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, whitecm
Colormap with plain white.
use colormaps cm = whitecm cm = whitecm(n)
whitecm(n) creates a color map with n identical entries corresponding to plain white. The color map is an n-by-3 array with one color per row; columns correspond to red, green, and blue components as real numbers between 0 to 1 (maximum intensity). The default value of n is 256.
The color map is suitable as the input argument of colormap.
colormap, black2orangecm, black2red2whitecm, blue2greencm, blue2yellow2redcm, cyan2magentacm, graycm, green2yellowcm, huecm, interprgbcm, magenta2yellowcm, red2yellowcm, sepiacm