필터 지우기
필터 지우기

colorbar tick decimal round

조회 수: 31 (최근 30일)
Hung Jr Chen
Hung Jr Chen 2016년 5월 2일
댓글: hossein 2018년 12월 14일
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.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 5월 2일
plot(1:10)
h=colorbar
t=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)
  댓글 수: 1
hossein
hossein 2018년 12월 14일
Work 100% Perfect. Thanks. A life save ;)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Colorbar에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by