How to show a colorbar of a certain range?
조회 수: 119 (최근 30일)
이전 댓글 표시
Hello all and happy Friday!
Let's say I have an image with a colormap and corresponding colorbar
I = imread('cameraman.tif');
imshow(I);
colormap jet
colorbar
I want the colorbar to only show colors for a certain range of values:
range_care = [100 150]; %show colors for values 100:150
Any ideas?
Thanks, plzzzz rply qckly its urgenttt
had to :)
댓글 수: 0
채택된 답변
Titus Edelhofer
2011년 7월 15일
Hi,
something like this:
h = colorbar;
set(h, 'ylim', [100 150])
Titus
댓글 수: 2
추가 답변 (4개)
Harsha Vardhan Rao Avunoori
2011년 7월 15일
Okay I don't know whether this is the right one or not.
But I have tried this.
I = imread('cameraman.tif');
imshow(I,'DisplayRange',[100 150]);
colormap jet
colorbar
Hope this is what your looking for.
-Harsha
Simone Gastaldon
2020년 11월 3일
I have a related problem, I don't know if this is the appropriate place to ask.
I'm plotting multiple sublots (9x2). For each row, the first sublot has a certain colorbar range and the second one has another. Each time I start plotting a new row (say r), the second subplot of the previous row (r-1,2) changes colorbar. I tried freezeColors and related utilities, to no avail. Anyone has advices?
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Orange에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!