# clim

Set colormap limits.

## Syntax

* clim(limits)
* clim('auto')
* clim('manual')
* clim(ax, ...)
* lims = clim()

## Input argument

* limits - New limits: \[cmin cmax].
* 'auto' - enables automatic limit updates when values in the colormap indexing array change.
* 'manual' - disables automatic limit update.
* ax - Target object: axes graphics object.

## Output argument

* lims - \[cmin cmax]

## Description

clim set or get colormap limits.

## Examples

```matlab
f = figure();
[X,Y] = meshgrid(-5:.5:5);
Z = X .^ 2 + Y .^ 2;
surf(Z);
limits = clim()
```

![](https://160667757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LdPvJ6mJve3gz5MU4d1%2Fuploads%2Fgit-blob-87d0374352245093350320f661a3aa40dcec4c13%2Fclim_1_18DD457D.svg?alt=media)

```matlab
f = figure();
[X,Y] = meshgrid(-5:.5:5);
Z = X.^2 + Y.^2;
surf(Z);
clim([25 75])
limits = clim()
```

![](https://160667757-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LdPvJ6mJve3gz5MU4d1%2Fuploads%2Fgit-blob-c2173d9825cf7c5690e5c8712570e3aac9f1226f%2Fclim_2_80AB730A.svg?alt=media)

## See also

[colormap](colormap), [colorbar](colorbar).

## History

| Version | Description     |
| ------- | --------------- |
| 1.0.0   | initial version |

## Author

Allan CORNET
