Rank: 190857 based on 0 downloads (last 30 days) and 0 file submitted
photo

Carola

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Carola
Updated File Comments Rating
07 Jan 2014 freezeColors / unfreezeColors Use multiple colormaps per figure! Version 2, now works for many types of objects, not only images. Author: John Iversen

Thank you for this very useful function. I love to use it.

However I seem to have a little problem with it. I'm using it with contourf with user-defined contour lines, and somehow the coloring of the fields changes when applying freezeColors while the colors of the colorbar remain the same with cbfreeze. To me it seems it has to do with the contour interval being a decimal number instead of an integer, but maybe there is another cause?

Here is a simple example of when it happens:

Z = peaks;
dc = 14/8;
c = -4:dc:10;
figure
subplot(1,2,1)
contourf(Z,c)
caxis([min(c) max(c)])
colormap(jet(8))
h=colorbar;
freezeColors
cbfreeze(h)
title('freezed colors')
subplot(1,2,2)
contourf(Z,c)
caxis([min(c) max(c)])
colormap(jet(8))
h=colorbar;
title('no freeze')

Contact us