How do I set a fixed color scheme for pcolor?
Show older comments
I'm making a graph of measurements, and pcolor is a very good way to display these data, but everytime the data is slightly different, the color scheme changes, which is annoying. I've tried some solutions with CData, but my inexperience has left me frustrated and with no solution when I try to extrapolate how to use CData based on other people's questions.
Basically, I want the colors to be the same every time in terms of order, not number, (.0143in can't always be blue, but blue always has to be the largest number).
Any help would be great. Here's my current code for the graph:
"figure
pcolor(postnomtable)
colorbar"
where postnomtable is an m by m matrix
1 Comment
Sebastian Holmqvist
on 10 Jul 2012
I'm not sure why you get different ordering of colors in your plots (I don't). The default colorscheme ('jet') is normally auto-scaled to have the highest number as red and the lowest as blue. The value right in between is somewhere around greenish.
You can use caxis([cmin cmax]) so specify your limits (everything outside of those limits gets the outermost color).
You can also use colormap('default') to set the current colorscheme as the default one for all future plots.
Accepted Answer
More Answers (0)
Categories
Find more on Blue 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!