MATLAB Answers


Editing a Colormap in MATLAB

Asked by martin martin on 19 Apr 2019
Latest activity Commented on by martin martin on 20 Apr 2019
Hello guys,
I have seen video about edit a colormap , but i don't know, how to save the setting after I edit values. Specific example ... I edit map on the top with the cursor of mouse (move positive and negative values to the center - zero). How can I get this setting always?


Sign in to comment.

1 Answer

Answer by Cris LaPierre
on 20 Apr 2019
 Accepted Answer

My suggestion would be to create an image, set it as you want, save the colormap and color axis limits to a mat file.
cmap = colormap(gca);
cl = caxis;
save cmap.mat cmap cl
Then, when you want to use the same colormap, load the mat file, and set the colormap and color axis limits to the values loaded in the mat file.
load cmap

  1 Comment

Hehe, thanks a lot, it works.

Sign in to comment.