MATLAB Function Reference
  Go to function:
    Search    Help Desk 
colorbar    Examples   See Also

Display colorbar showing the color scale

Syntax

Description

The colorbar function displays the current colormap in the current Figure and resizes the current Axes to accommodate the colorbar.

colorbar updates the most recently created colorbar or, when the current Axes does not have a colorbar, colorbar adds a new vertical colorbar.

colorbar('vert') adds a vertical colorbar to the current Axes.

colorbar('horiz') adds a horizontal colorbar to the current Axes.

colorbar(h) places a colorbar in the Axes identified by h. The colorbar is horizontal if the width of the Axes is greater than its height, as determined by the Axes Position property.

h = colorbar(...) returns a handle to the colorbar, which is an Axes graphics object.

Remarks

colorbar works with two-dimensional and three-dimensional plots.

Examples

Display a colorbar beside the Axes:

See Also

colormap



[ Previous | Help Desk | Next ]