clim

Gets or sets the color limits of the current axes.

Category: Graphics > Formatting and Annotation

Syntax

clim([cmin cmax])

Sets the limits.

lims = clim

Returns the current limits.

clim auto / clim manual

Chooses limits from the data, or freezes them.

Description

Data values at or below cmin get the first color of the colormap, and values at or above cmax get the last. Setting the same limits on several axes makes their colors comparable. In older code the same function is called caxis.

Input arguments

[cmin cmax]
Two-element vector with cmin less than cmax.

Output arguments

lims
Two-element vector with the current limits.

Example

Fixing the color range

imagesc(magic(4))
clim([0 20])
disp(clim)
Output
     0    20

See also

colormap colorbar caxis imagesc