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
2015년 8월 25일
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.
카테고리
도움말 센터 및 File Exchange에서 Color and Styling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!