rescale the colour range or squeez the colours

I have a color bar scale changing from 600 to 1020 based on the matrix values while only 2 colors of the range change from day to day. In other hand the most variations in my project belong to the range between 950 to 1025 or 1030. When I use caxis, the colorbar scale doesn't change and I see the range from 900 to 1030 for example which is correct but the pattern colour changes & goes to the real clour belonging to their own values. How can I see the same colour variations but for the new range. xlim and ylim doesn't work in this case.

답변 (3개)

Chad Greene
Chad Greene 2015년 8월 25일

0 개 추천

If you can give some example data that would help. But this might be the fix you're looking for. If you start with
colormap(jet(256))
That sets the colormap to a 256-level rainbow colormap. If you only want to show part of that rainbow you can do
mycolormap = jet(256);
colormap(mycolormap(100:160,:))
to show levels 100 to 160 of the rainbow colormap.
I should clarify, I use the rainbow colormap only because it's a simple example that you can replicate on any version of Matlab. In general, it is a bad colormap. I recommend using Stephen Cobeldick's brewermap instead.
SH
SH 2015년 8월 25일

0 개 추천

this is what I get based on the real data
SH
SH 2015년 8월 25일

0 개 추천

and after using caxis ([900 1030]):

댓글 수: 1

SH
SH 2015년 8월 25일
But on the map again I want to see for example dark red for 1030 and dark blue for 900.

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

카테고리

도움말 센터File Exchange에서 Color and Styling에 대해 자세히 알아보기

질문:

SH
2015년 8월 25일

댓글:

SH
2015년 8월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by