How to save a new modified colormap ?
Afficher commentaires plus anciens
Hi, I have been using the 'jet' colormap to display my figures, but I want to make a minor modification. I want to set the 0 values to be black. I changed this by setting the middle rows in the existing colormap data to zero.
mymap = jet; mymap(32:33,:)=0;
how do I save this new colormap called 'mymap', so that I can use it as a colormap?
Réponses (1)
filename = 'C:\Me\colourmaps\myColourmap.mat';
save( filename, 'mycmap' );
Obviously filename is whatever you choose it to be, but should ideally be a full path. It doesn't have to be, if not it will be saved in the current directory, but I prefer to be explicit.
2 commentaires
Mostafa Ibrahim
le 5 Sep 2018
Modifié(e) : Mostafa Ibrahim
le 5 Sep 2018
Hi Adam, and how to call this file again to use it please
Adam
le 6 Sep 2018
loadedData = load( filename, 'mycmap' );
colormap( hAxes, loadedData.mycmap );
where hAxes is your axes handle
Catégories
En savoir plus sur Color and Styling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!