slim_colorbar(varar​gin)

Version 1.3.0.0 (1.35 KB) by Yifan Gu
Just like matlab colorbar but it keeps the size of the associated axes unchanged.
147 Downloads
Updated 8 Feb 2017

View License

SLIM_COLORBAR Display color bar (color scale)
Just like matlab colorbar but it keeps the size of the associated axes
unchanged and allows user to specify the width of colorbar.
USAGE:
slim_colorbar
slim_colorbar(width)
slim_colorbar(width, ax_acc)
[ ax_c ] = slim_colorbar(...)
ARGUMENTS (optional):
width -- width of colorbar (% of figure width, suggest 0.01)
ax_acc -- the associated axes (the default is the current one)
OUTPUT:
ax_c -- axes handle of the colorbar

EXAMPLE:
{
figure('NumberTitle','Off','Name','Slim colorbar','color','w');
subplot(2,2,1);
plot(1:10);
subplot(2,2,3);
plot(1:10);
xlabel('Matlab colorbar')
colorbar
subplot(2,2,2);
plot(1:10);
ax_acc = subplot(2,2,4);
plot(1:10);
xlabel('Slim colorbar')
slim_colorbar(0.01, ax_acc);
% or slim_colorbar(0.01)
% or simply slim_colorbar;
}

Cite As

Yifan Gu (2024). slim_colorbar(varargin) (https://www.mathworks.com/matlabcentral/fileexchange/61455-slim_colorbar-varargin), MATLAB Central File Exchange. Retrieved .

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

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.3.0.0

Format the description.

1.2.0.0

Now the function can be called without any input arguments.

1.1.0.0

Add the screenshot.

1.0.0.0