rescale the colour range or squeez the colours
9 views (last 30 days)
Show older comments
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.
0 Comments
Answers (3)
Chad Greene
on 25 Aug 2015
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.
0 Comments
See Also
Categories
Find more on Red in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!