FUNCTION REFERENCE
colormap
Set or query the colormap of the current figure or axes.
Set or query the colormap of the current figure or axes.
Syntax
colormap nameSyntax
colormap(map)Syntax
colormap(target, map)Syntax
map = colormapname is one of viridis, parula, gray, hot, cool, jet, hsv, bone, copper, winter, spring, summer, autumn, pink, lines, white, colorcube, prism, flag or default; map is an n-by-3 matrix of RGB values in [0,1]. With a figure (or no) target the map applies to every axes of the figure; with an axes handle only to that axes. colormap with no arguments returns the current map, 256 rows by default.
Example
colormap('hot'); m = colormap; size(m) % [256 3]Example
colormap(gray(8)); m = colormap; m(end,:) % [1 1 1]Differences from MATLAB: The default map is viridis (van der Walt and Smith, CC0), not parula; the name parula gives viridis too. colormap(...) only returns a value in the no-argument form.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.