alim

Gets or sets the alpha (transparency) limits of the current axes.

Category: Graphics > Formatting and Annotation

Syntax

alim([amin amax])

Sets the alpha limits.

lims = alim

Returns the current limits.

alim auto

Chooses limits from the data.

Description

The limits matter for objects whose transparency comes from per-point AlphaData with scaled mapping. They play the same role for transparency as clim does for color.

Input arguments

[amin amax]
Two-element vector. Data at or below amin is fully transparent and at or above amax is fully opaque, when the object maps its AlphaData through the alphamap.

Output arguments

lims
Current alpha limits.

Example

Setting the limits

[X, Y, Z] = peaks(20);
surf(X, Y, Z, 'FaceAlpha', 'flat', 'AlphaData', Z);
alim([-5 5])
disp(alim)
Output
    -5     5

See also

alpha alphamap clim surf