How can I change numbers on colorbar?
22 次查看(过去 30 天)
显示 更早的评论
When I show image (uint8) with imshow, and add the colorbar, the colorbar has numbers from 0 to 255 which is logic. Because I want my image to give me the most info that it can, I use histeq and limit my image from 35 to 90 values.
However, I have the picture that gives me enough info, but I want the colorbar from 0 to 1. Because my picture is a NDVI with values from 0 to 1 (0 for non vegetation areas and 1 for vegetation ares).
Is that even possible?
thx, A.
0 个评论
回答(1 个)
Amith Kamath
2013-8-22
you can set the CLim (color limits of the bar) using caxis([min, max]). The default value is the min and max of the plotted data.
For example,
figure,
subplot(2,1,1)
surf(peaks)
colorbar
subplot(2,1,2)
surf(peaks)
caxis([-2, 2])
colorbar
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Colorbar 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!