Skip to content

MATLAB function to make divergent colormaps with the color white always centered on zero.

License

Notifications You must be signed in to change notification settings

matteocourthoud/centered-colormap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

MATLAB function to make divergent colormaps with the color white always centered on zero.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages