image thumbnail


version (4.39 KB) by Blair Greenan
Add an accurate colorbar to your filled contour plot.


Updated 04 Apr 2006

View License

Editor's Note: This file was a File Exchange Pick of the Week

This m-file produces a colorbar with solid blocks of color between the contour levels that correspond precisely to the colors in the filled contour plot. This is in contrast to the standard MATLAB colorbar which simply plots all the colors in the colormap and, therefore, only approximates what is being plotted in the filled contour plot.

Cite As

Blair Greenan (2022). colorbarf (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: cbarf

Community Treasure Hunt

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

Start Hunting!