plot_colorbar
Version 1.0.0.0 (1.81 KB) by
Matthew Foster
Plot a colorbar as a figure for publication.
Plots a vertical or horizontal colorbar for inclusion in a publication. The specified colorbar can be plotted either horizontally or vertically, and a function handle can be passed in to allow the use of different colormaps.
Written during some recent work, and then cleaned up and published here in case it's useful to anyone else.
Examples:
h1 = plot_colorbar([100, 5], 'h', 'Test Colormap')
h2 = plot_colorbar([150, 10], 'v', 'Test Colormap', @hsv)
Cite As
Matthew Foster (2026). plot_colorbar (https://www.mathworks.com/matlabcentral/fileexchange/19591-plot_colorbar), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2007a
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Color and Styling in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
