How can I change the tick labels in a colorbar
조회 수: 1 (최근 30일)
이전 댓글 표시
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?
댓글 수: 0
채택된 답변
Adam
2017년 2월 10일
편집: Adam
2017년 2월 10일
figure; hAxes = gca;
imagesc( hAxes, rand( 25 ) );
hc = colorbar( hAxes );
hc.TickLabels = arrayfun( @num2str, hc.Ticks * 100, 'UniformOutput', false );
댓글 수: 3
Adam
2017년 2월 10일
hc.TickLabels = arrayfun( @(x) [num2str(x) '%'], hc.Ticks * 100, 'UniformOutput', false );
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Colorbar에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!