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;