项目作者: matteocourthoud

项目描述 :
MATLAB function to make divergent colormaps with the color white always centered on zero.
高级语言: MATLAB
项目地址: git://github.com/matteocourthoud/centered-colormap.git
创建时间: 2021-02-27T19:39:25Z
项目社区:https://github.com/matteocourthoud/centered-colormap

开源协议:MIT License

下载


Centered Colormap

by Matteo Courthoud

function file: centered.m

example file: example.m


This package provides colormaps centered on the white color corresponding to zero. Just specify centeredas an argument to a colormap to use the default centered colormap.

  1. surf(peaks(25)+2);
  2. colormap(centered), colorbar

example1

Even if the scale is asymmetric (positive), the palette has the color white centered on zero.

The function takes different color palettes as arguments.

palettes

For example, we can use the BrBg palette.

  1. contourf(peaks(25)-2,25,'linestyle','none');
  2. colormap(centered('BrBg')), colorbar;

example2

Again, even if the scale is asymmetric (negative), the palette has the color white centered on zero.