Colormap fixed middle value
Show older comments
Hej all, for a pcolor plot I have built the ratio of a treatment vs. a control (A./B) and want to plot the resulting pcolor plot with colors according to their value - In this case, 0-1 should always be in a gradient from blue to white, while everything above 1 (differing maxValues) should be in a gradient white to red. Is there a way to "fix" the colorbar so that the white color will always be displayed at value 1 of my data? (or can I use 2 colormaps for this somehow?)

Accepted Answer
More Answers (1)
Debashish Saha
on 3 Jul 2018
0 votes
Hi Brandon, does it also work for a vector containing negative values? In my case, it seems that 0 value is not at the exact location / point of white in the color bar. Should one take the absolute of the smallest value to negate the negative number in the vector while determining the index in your code? Thanks in advance. Cheers, DS
Categories
Find more on Color and Styling 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!