"default"
)Query or set the current colormap.
With no input arguments, colormap
returns the current color map.
colormap (map)
sets the current colormap to map. The
colormap should be an n row by 3 column matrix. The columns
contain red, green, and blue intensities respectively. All entries
must be between 0 and 1 inclusive. The new colormap is returned.
colormap (
restores the default colormap (the
"default"
)viridis
map with 64 entries). The default colormap is returned.
The map may also be specified by a string, map_name, which is the name of a function that returns a colormap.
If the first argument hax is an axes handle, then the colormap for the parent figure of hax is queried or set.
For convenience, it is also possible to use this function with the
command form, colormap map_name
.
The list of built-in colormaps is:
Map | Description |
---|---|
viridis | default |
jet | colormap traversing blue, cyan, green, yellow, red. |
cubehelix | colormap traversing black, blue, green, red, white with increasing intensity. |
hsv | cyclic colormap traversing Hue, Saturation, Value space. |
rainbow | colormap traversing red, yellow, blue, green, violet. |
————- | ——————————————————————————————— |
hot | colormap traversing black, red, orange, yellow, white. |
cool | colormap traversing cyan, purple, magenta. |
spring | colormap traversing magenta to yellow. |
summer | colormap traversing green to yellow. |
autumn | colormap traversing red, orange, yellow. |
winter | colormap traversing blue to green. |
————- | ——————————————————————————————— |
gray | colormap traversing black to white in shades of gray. |
bone | colormap traversing black, gray-blue, white. |
copper | colormap traversing black to light copper. |
pink | colormap traversing black, gray-pink, white. |
ocean | colormap traversing black, dark-blue, white. |
————- | ——————————————————————————————— |
colorcube | equally spaced colors in RGB color space. |
flag | cyclic 4-color map of red, white, blue, black. |
lines | cyclic colormap with colors from axes "ColorOrder" property. |
prism | cyclic 6-color map of red, orange, yellow, green, blue, violet. |
————- | ——————————————————————————————— |
white | all white colormap (no colors). |
See also: viridis, jet, cubehelix, hsv, rainbow, hot, cool, spring, summer, autumn, winter, gray, bone, copper, pink, ocean, colorcube, flag, lines, prism, white.
The following code
## Create an image for displaying a colormap image (1:64, linspace (0, 1, 64), repmat ((1:64)', 1, 64)); axis ([1, 64, 0, 1], "ticy", "xy"); ## Show 'viridis' colormap colormap (viridis (64)); title "colormap (viridis (64))" disp ("Press a key to continue"); pause (); ## Show 'colorcube' colormap colormap (colorcube (64)); title "colormap (colorcube (64))"
Produces the following output
Press a key to continue
and the following figure
Figure 1 |
---|
Package: octave