Editing a Colormap in MATLAB
29 views (last 30 days)
Show older comments
martin martin
on 19 Apr 2019
Commented: Cris LaPierre
on 14 Apr 2022
Hello guys,
I have seen video about edit a colormap https://www.mathworks.com/videos/interactively-editing-a-colormap-in-matlab-97147.html , 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?

0 Comments
Accepted Answer
Cris LaPierre
on 20 Apr 2019
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
contourf(X,Y,z)
colormap(cmap);
colorbar
caxis(cl);
3 Comments
Cris LaPierre
on 14 Apr 2022
You appear to be trying to save the file to a location you do not have write permission. Try changing your current folder location.
More Answers (0)
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!