I figured this out actually:
the ticks should be between (0,1) to work:
colormap([0 0 1; 0 1 1;0 1 0; 1 0 0;1 1 0])
colorbar('Ticks', [0 0.2 0.4 0.6 0.8 1], 'TickLabels',[0 5 40 1000 1000 2000])
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!