ColormapsNc is able to create a custom colormap by specifying up to 256 different colors. The colors will be shown in the order you chose them from the botton to the top of the colorbar.
If you execute this program after that a figure with your own data has been generated, the ColormapsNc will apply automatically the new colormap generating a new colorbar.

This program is an upgrade of the COLORMAPS3C program written by me.

See also COLORBAR, COLORMAP.

Tested under MATLAB 5.3 and MATLAB 6.0.

Danilo Botta 30-05-04

Comments and Ratings (11)

I solved it by printing the matrix with the color information, "special", in the command window and save it as a text file. Then import it into the plot script with
color_matrix=textread('colors_legend.txt');
Ta-dam! Now you can use your own color legend:
colormap(color_matrix)

For me it didn't work completely as the pre defined colormaps, I was not able to limit the colors in the legend as you can for example with "jet(20)". But this trick modifying the color matrix solved it:
k=1;
for j=1:levels
my_colors(j,:)=color_matrix(k,:);
k=k+round(length(color_matrix)/levels);
end