Hi, very nice contribution.
I had a problem using the code in a gui environment. The problem is, that the current axis is not always that axis which is used for plotting, if you define an axis property in the plot command. You may than use freezeColors(axis_handle). But the caxis command in the code does not use that axis_handle. Therefor I changed in line 86: cax=caxis to cax=caxis(h). Than everything works fine.
Hi everyone. I found out how to freeze the colorbar as well. Actually, I got my answer from the test_main.m file of this submission. You should download cbfreeze.m and cbhandle.m (by Carlos Adrian Vargas Aguilera) and freeze your colorbar with these functions. Just make sure to download cbhandle.m as well or MATLAB will give you some handle errors.
I am using cbfreeze in conjunction with freezeColors on a multi-subplot figure to be able to use different colorbars in each subplot. My problem is that cbfreeze freezes the colorbar nicely, but it removes the order of magnitude for the ticks. Usually the order of magnitude appears as a small number on the top right of the colorbar (say, the ticks go from 10^5-10*10^5, then the tick marks are 1-10 and the 10^5 appears once on the top right of the colorbar for a vertical colorbar). Any suggestions on how I can get my order of magnitude back?
Thanks a lot!