MATLAB: Colorbar tick decimal round colorbar Hi, I would like to round my colorbar values to 2 decimal places, is it possible? Like in my figure, it has 4 dicimal places, 0.0372, I would like to display to 0.04 only. I don't know how to do that :S I try: but failed. Best Answer plot(1:10)h=colorbart=get(h,'Limits');T=linspace(t(1),t(2),5)set(h,'Ticks',T)TL=arrayfun(@(x) sprintf('%.2f',x),T,'un',0)set(h,'TickLabels',TL) Related SolutionsMATLAB: How to display min and max in the colorbar h=colorbart=get(h,'Limits');set(h,'Ticks',linspace(t(1),t(2),5) MATLAB: How to change color bar for images function Try thisimagesc(full_B);colorbar;colormap(jet(256));or even better:imshow(full_B, []);colorbar;colormap(jet(256)); Related QuestionOnes Function Giving Me Decimal PointsECG-like grid on figureColorbar tick labels – set decimals placesSST Colormap similar to the OdysseaHow to set rounded to 4 decimal places for a vector
Best Answer