Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 953 Bytes

README.md

File metadata and controls

35 lines (21 loc) · 953 Bytes

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.

surf(peaks(25)+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.

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

example2

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