Alternatively, you can hardcode them and have an if statement with graphicsversion(fhandle) on it.

It returns returns true if the default graphics system is the old handle graphics one.


You could also try to get an extensive list, and then check if colormapname.m is a file in matlabroot\toolbox\matlab\graph3d. If the function is there, the colormap comes in that version. You'd still need to hardcode an extensive list though.

EDIT: as @thewaywewalk suggests, you could open Contents.min matlabroot\toolbox\matlab\graph3d and esarch for % Color maps. It has a list of the colormaps included in the version. In 2014b its on lines 29-48

Answer from Ander Biguri on Stack Overflow
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
colormap - View and set current colormap - MATLAB
A value of 'default' sets the colormap to the default colormap for the target object. The following table lists the predefined colormaps.
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling
Color and Styling - MATLAB & Simulink
Specify themes for figures, customize colors and line styles for 2-D plots, and select colormaps for surfaces, patches, and indexed images.
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
Change Color Scheme Using a Colormap - MATLAB & Simulink
You can also create your own colormap as an m-by-3 array. Each row in the array contains the red, green, and blue intensities of a different color. The intensities are in the range [0,1]. Here is a simple colormap that contains three entries.
🌐
EDUCBA
educba.com › home › data science › data science tutorials › matlab tutorial › colormap in matlab
Colormap in Matlab | Explore How Colormap in Matlab Works?
June 14, 2023 - Below is the list of RGB triplets to get various colors: MATLAB also supports some pre-defined colormaps.
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
MathWorks
mathworks.com › matlabcentral › fileexchange › 35242-matlab-plot-gallery-colormap-chart
MATLAB Plot Gallery - Colormap Chart - File Exchange - MATLAB Central
December 19, 2018 - This is an example of creating a chart of built-in colormaps in MATLAB®. Read about the "colormap" function in the MATLAB documentation.
Find elsewhere
🌐
MATLAB
matlab.izmiran.ru › help › techdoc › ref › colormap.html
colormap (MATLAB Functions)
colormap(map) sets the colormap to the matrix map. If any values in map are outside the interval [0 1], MATLAB returns the error Colormap must have values in [0,1]
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
lines - Lines colormap array - MATLAB
This MATLAB function returns the lines colormap as a three-column array with the same number of rows as the colormap for the current figure (gcf).
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
jet - Jet colormap array - MATLAB
This MATLAB function returns the jet colormap as a three-column array with the same number of rows as the colormap for the current figure (gcf).
🌐
MathWorks
mathworks.com › videos › colormaps-97486.html
How to Use Colormaps in MATLAB - MATLAB
February 15, 2022 - Learn how to utilize colormaps in MATLAB® to more effectively visualize and convey 2D and 3D graphics objects.
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
rgbplot - Plot colormap - MATLAB
This table lists the RGB triplet values for common colors. Alternatively, you can create the matrix by calling one of the predefined colormap functions. Call the function as the input argument to the rgbplot function. For example, this command plots the parula colormap. ... Run the command by entering it in the MATLAB ...
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
Colormap Editor - Open colormap editor - MATLAB
HSV — MATLAB calculates values in the new colormap by linearly interpolating the hue, saturation, and value coordinates. Hue corresponds to the values on a color wheel that transition from red to orange, yellow, green, cyan, blue, magenta, and finally back to red.
🌐
FieldTrip toolbox
fieldtriptoolbox.org › faq › plotting › colormap
Which colormaps are supported? - FieldTrip toolbox
September 8, 2025 - The following sections of code loop through a large number of the available colormaps. cmap = {'parula', 'jet', 'hsv', 'hot', 'cool', 'spring', 'summer', 'autumn', 'winter', 'gray', 'bone', 'copper', 'pink', 'lines', 'colorcube', 'prism', 'flag'}; figure set(gcf, 'Name', 'matlab') for ...
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
cool - Cool colormap array - MATLAB
This MATLAB function returns the cool colormap as a three-column array with the same number of rows as the colormap for the current figure (gcf).
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
gray - Gray colormap array - MATLAB
This MATLAB function returns the gray colormap as a three-column array with the same number of rows as the colormap for the current figure (gcf).