Positive-zero-negative colorbar

Create positive-zero-negative colormaps and colorbars. Customized colormap/colorbar options are available.

Download
Download

You are now following this Submission

Cite As

Xiaowei He (2026). Positive-zero-negative colorbar (https://in.mathworks.com/matlabcentral/fileexchange/110190-positive-zero-negative-colorbar), MATLAB Central File Exchange. Retrieved .

Tags

Add Tags

Add the first tag.

General Information

MATLAB Release Compatibility

  • Compatible with R2014b and later releases

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.8.1

Fixed a bug where using the 'log' option with both negative caxis limits [caxis1, caxis2] <= 0 gives wrong color maps.

Download
1.8.0

- Function name changed to >>colorbarpzn denoting positive-zero-negative. 'colorW' option name changed to 'colorZ' accordingly.
- Fix a bug when using the 'full' option without specifying 'Wvalue' gives a false error.

Download
1.7.2

- Fixed a bug where the number of levels is incorrect when using the 'log' option.
- Fixed a bug where the 'White' color is missing when generating a one-sided colorbar/colormap.

Download
1.7.1

- Fixed a bug in v1.7.0 where using [R G B] and P2value/N2value together in 'colorP2' or 'colorN2' can cause a fault error.

Download
1.7.0

- Added options 'colorP2' and 'colorN2' for secondary colors in the positive and negative color spectra, respectively.
- Predefined colors can now be used for 'colorP', 'colorN', 'colorW', as well as the new 'colorP2' and 'colorN2' options.

Download
1.6.1

- Fixed a bug in v1.6.0 where the white color is not at zero when using default cmin and cmax settings.

Download
1.6.0

- Added an option 'wrs' for extending the white color region so small values are displayed in a uniform color.
- Adjusted the default color.
- Fixed a bug where an even number level cannot be generated.
- 'off' potion can be used without an output.

Download
1.5.0

- Added predefined low-saturation colors which allows for changing the default colormap with combinations of these predefined colors.
- Fixed a bug that causes errors when the colorbar label string is the same as one of the input arguments.

Download
1.4.0

- Added support for reversed colorbar direction by switching cmin and cmax order.
- Removal of the caxix1 < caxis2 rule accordingly.
- Fixed a bug that causes an error when using 0 or 1 as the first caxis limit.
- Updates in description and examples.

Download
1.3.0

- Added support for setting colormap and displaying colorbar on specific target, e.g., colorbarpwn(ax, cmin, cmax).
- Updates and corrections in headline description and examples.

Download
1.2.0

- Changed the function name from >>colorbarPWN to >>colorbarpwn for friendlier user experience.
- Added an option 'off' which disables creating the colorbar and only returns the colormap array.
- Updates in the headlines including a few examples.

Download
1.1.1

- Minor code improvement.
- Updates in headline descriptions.

Download
1.1.0

Download