Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

colormaplist

Provide list of colormaps.

Syntax

  • colormaps = colormaplist()

Output argument

  • colormaps - String vector of colormaps sorted in ascending order.

Description

colormaplist returns the available colormaps as an m-by-1 string array.

Example

f = figure('Position', [100, 100, 600, 400], 'Resize', 'off');
ax = axes('Position', [0.1, 0.2, 0.6, 0.7]);
surf(ax, peaks);
cmaps = colormaplist;
listbox = uicontrol('Style', 'listbox', 'Position', [450, 100, 100, 200], 'String', cmaps);
listbox.Callback = @(src, void) colormap(ax, cmaps(src.Value));

See also

colormap.

History

VersionDescription
1.14.0initial version

Author

Allan CORNET