MATLAB: How to delimit the number of decimal places in a colorbar

colorbar

In this case, for example:
contourf(peaks(60))
colormap cool
colorbar('location','southoutside')
i want 4 decimal places.
thnks in adv,

Best Answer

contourf(peaks(60))
colormap cool
h=colorbar('location','southoutside');
yt=get(h,'XTick');
set(h,'XTickLabel',sprintf('%2.4f|',yt));
Cheers!