Display colorbar with evenly spaced tick intervals but unequal difference between tick values

조회 수: 32 (최근 30일)
How to display colorbar with evenly spaced tick intervals (i.e., equal sized blocks) but with unequal difference between tick values? (I don't want a log scale)
I have attached a figure indicating the required format of colorbar.

답변 (1개)

Chunru
Chunru 2022년 8월 27일
image
h=colorbar;
% change ticks and ticklabels to the values you want
h.Ticks=[0 10 20 30 40 50 100 200 255];
h.TickLabels = string([0 0.1 0.2 0.3 0.4 0.5 1 2 2.56]);
  댓글 수: 4
Chunru
Chunru 2022년 8월 31일
You need to find the relationship between the original XTicks and the TickLabels you want. By changing them, you can obtain arbitrary ticks and labels.
Himanshu Saxena
Himanshu Saxena 2022년 8월 31일
Thanks for the suggestion. I wish I could do that. I only know basics in MATLAB.

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

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by