I really wish there were some good built-in colormaps. I keep trying to explain to my colleagues that they need to pick their colors carefully, and then I have to climb an extra hill of explaining where to find them and how to import them into Matlab properly. It makes it look like I'm wasting people's time Answer from GustapheOfficial on reddit.com
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
colormap - View and set current colormap - MATLAB
A colormap is a matrix of values that define the colors for graphics objects such as surface, image, and patch objects. MATLAB® draws the objects by mapping data values to colors in the colormap.
Discussions

What's your favorite colormap?
I really wish there were some good built-in colormaps. I keep trying to explain to my colleagues that they need to pick their colors carefully, and then I have to climb an extra hill of explaining where to find them and how to import them into Matlab properly. It makes it look like I'm wasting people's time More on reddit.com
🌐 r/matlab
16
11
April 3, 2024
How can I make a "color map" plot in matlab? - Stack Overflow
How is the gnuplot function different from Matlab's mesh? With Mesh the color is proportional to the surface height. ... I don't want a surface; I just want a 2D map with colors. ... By default mesh will color surface values based on the (default) jet colormap (i.e. More on stackoverflow.com
🌐 stackoverflow.com
You should never use the default colors in Matlab. This is why and what you can do about it.

Thank you. Jet must die.

For those who are interested in using cbrewer.m, here's what I've got in my startup.m:

set(0,'DefaultAxesColorOrder',cbrewer('qual','Set2',8))
set(0,'DefaultLineLineWidth',1.2)
set(0,'DefaultFigureColormap',cbrewer('seq','YlOrRd',64));       

Makes looking at plots in Matlab way more tolerable. Substitute YlOrRd with your favorite colorbrewer colormap.

More on reddit.com
🌐 r/matlab
32
97
August 6, 2013
Two colormaps on one set of axes

Basically, you can draw the first image, then call 'hold on', and then plot the second. Remember to call 'hold off' when you are done, or subsequent graphics will be drawn in the same axes. Such as:

Z = 10 + peaks;
surf(Z)
hold on
image(Z,'CDataMapping','scaled')
hold off

More on reddit.com
🌐 r/matlab
3
2
September 13, 2017
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
Change Color Scheme Using a Colormap - MATLAB & Simulink
MATLAB® uses a default color scheme when it displays visualizations such as surface plots. You can change the color scheme by specifying a colormap.
🌐
Reddit
reddit.com › r/matlab › what's your favorite colormap?
r/matlab on Reddit: What's your favorite colormap?
April 3, 2024 - Parula. If I'm looking for something specific like a diverging map or a color map that's not in a specific order, I really like cbrewer. It's got a ton of colormaps and you can customize the maps quite a bit.
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
Control Colormap Limits - MATLAB & Simulink
For many types of visualizations you create, MATLAB® maps the full range of your data to the colormap by default. The smallest value in your data maps to the first row in the colormap, and the largest value maps to the last row in the colormap.
🌐
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).
🌐
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).
Find elsewhere
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
Colormap Editor - Open colormap editor - MATLAB
Color data value in the CData property of the graphics object using the colormap, specified as a number between CLim Minimum and CLim Maximum. Number of colors, specified as an integer in the range [1, 1000]. Interpolating colorspace, specified as one of these values: RGB — MATLAB calculates values in the new colormap by linearly interpolating the red, green, and blue components of color.
🌐
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
hot - Hot colormap array - MATLAB
This MATLAB function returns the hot 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
How Image Data Relates to a Colormap - MATLAB & Simulink
When you display images using the image function, you can control how the range of pixel values maps to the range of the colormap. For example, here is a 5-by-5 magic square displayed as an image using the default colormap. ... A contains values between 1 and 25. MATLAB® treats those values as indices into the colormap, which has 64 entries.
🌐
MathWorks
mathworks.com › matlab › graphics › labels and styling › color and styling
parula - Parula colormap array - MATLAB
This MATLAB function returns the parula 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
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).
🌐
Northwestern University
ece.northwestern.edu › local-apps › matlabhelp › techdoc › ref › colormap.html
colormap (MATLAB Functions)
A colormap is an m-by-3 matrix of real numbers between 0.0 and 1.0. Each row is an RGB vector that defines one color.
🌐
The Knowledge Academy
theknowledgeacademy.com › blog › matlab-colormap
MATLAB Colormap: The Power of Color in Your Data Visualizations
October 31, 2025 - Colormaps create a smooth transition of colours that indicate the changing values for continuous data, such as temperature or elevation. This enables viewers to perceive gradients and identify high or low points quickly.
Top answer
1 of 4
43

By default mesh will color surface values based on the (default) jet colormap (i.e. hot is higher). You can additionally use surf for filled surface patches and set the 'EdgeColor' property to 'None' (so the patch edges are non-visible).

[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;

% surface in 3D
figure;
surf(Z,'EdgeColor','None');

2D map: You can get a 2D map by switching the view property of the figure

% 2D map using view
figure;
surf(Z,'EdgeColor','None');
view(2);    

... or treating the values in Z as a matrix, viewing it as a scaled image using imagesc and selecting an appropriate colormap.

% using imagesc to view just Z
figure;
imagesc(Z); 
colormap jet; 

The color pallet of the map is controlled by colormap(map), where map can be custom or any of the built-in colormaps provided by MATLAB:

Update/Refining the map: Several design options on the map (resolution, smoothing, axis etc.) can be controlled by the regular MATLAB options. As @Floris points out, here is a smoothed, equal-axis, no-axis labels maps, adapted to this example:

figure;
surf(X, Y, Z,'EdgeColor', 'None', 'facecolor', 'interp');
view(2);
axis equal; 
axis off;

2 of 4
19

gevang's answer is great. There's another way as well to do this directly by using pcolor. Code:

[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
figure;
subplot(1,3,1);
pcolor(X,Y,Z); 
subplot(1,3,2);
pcolor(X,Y,Z); shading flat;
subplot(1,3,3);
pcolor(X,Y,Z); shading interp;

Output:

Also, pcolor is flat too, as show here (pcolor is the 2d base; the 3d figure above it is generated using mesh):

🌐
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).