How can I center the ColorBrewer colors around 0?

23 Ansichten (letzte 30 Tage)
dila suay
dila suay am 24 Feb. 2022
Kommentiert: dila suay am 25 Feb. 2022
Hello, I am using cbrewer for my colormap. However the value 0 is not exactly white (attached jpg image). I have played around with the n, but nothing seems to change.
n=256
colormap(cbrewer2('RdBu',n));
How can I make the 0 value true white?
Thank you

Akzeptierte Antwort

DGM
DGM am 25 Feb. 2022
This doesn't have anything to do with the particular colormap. This has to do with the fact that the colorbar limits are not centered on zero.
Try:
caxis([-8 8])

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by