MATLAB: How to change the tick labels in a colorbar

colorbarimage processing

I have some images that contain probability data. Thus, the colorbar is [0 1]. However, when I plot them I want the colorbar tick labels to be [0% 100%](without changing the image). Is there a way to do so?

Best Answer

figure; hAxes = gca;
imagesc( hAxes, rand( 25 ) );
hc = colorbar( hAxes );
hc.TickLabels = arrayfun( @num2str, hc.Ticks * 100, 'UniformOutput', false );