Display colorbar with evenly spaced tick intervals but unequal difference between tick values
10 次查看(过去 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.
0 个评论
回答(1 个)
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
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colorbar 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!