image thumbnail

MATLAB Plot Gallery - Using Colorbars (2)

by

 

23 Feb 2012 (Updated )

Add a horizontal colorbar

Add_Colorbar_to_Plot_2

This is an example of how to add a horizontal colorbar to a plot in MATLAB®.

Read about the colorbar function in the MATLAB documentation.

For more examples, go to MATLAB Plot Gallery

% Load spine data
load spine X

% Create an image plot of the spine data
figure
imagesc(X)
colormap bone

% Add a horizontal colorbar to the bottom of the plot
colorbar('SouthOutside')
axis square

Contact us