| MATLAB Function Reference | ![]() |
Set transparency properties for objects in current axes
Syntax
Description
alpha
sets one of three transparency properties, depending on what arguments you specify with the call to this function.
FaceAlpha
alpha(face_alpha)
set the FaceAlpha property of all image, patch, and surface objects in the current axes. You can set face_alpha to:
FaceAlpha property to the specified value (for images, set the AlphaData property to the specified value)
'flat' - set the FaceAlpha property to flat
'interp' - set the FaceAlpha property to interp
'texture' - set the FaceAlpha property to texture
'opaque' - set the FaceAlpha property to 1
'clear' - set the FaceAlpha property to 0
See Specifying a Single Transparency Value for more information.
AlphaData (Surface Objects)
alpha(alpha_data)
sets the AlphaData property of all surface objects in the current axes. You can set alpha_data to:
CData - sets the AlphaData property to the specified values
'x' - set the AlphaData property to be the same as XData
'y' - set the AlphaData property to be the same as YData
'z' - set the AlphaData property to be the same as ZData
'color' - set the AlphaData property to be the same as CData
'rand' - set the AlphaData property to a matrix of random values equal in size to CData
AlphaData (Image Objects)
alpha(alpha_data)
sets the AlphaData property of all image objects in the current axes. You can set alpha_data to:
CData - sets the AlphaData property to the specified value
'x' - ignored
'y' - ignored
'z' - ignored
'color' - set the AlphaData property to be the same as CData
'rand' - set the AlphaData property to a matrix of random values equal in size to CData
FaceVertexAlphaData (Patch Objects)
alpha(alpha_data)
sets the FaceVertexAlphaData property of all patch objects in the current axes. You can set alpha_data to:
FaceVertexCData - sets the FaceVertexAlphaData property to the specified value
'x' - set the FaceVertexAlphaData property to be the same as Vertices(:,1)
'y' - set the FaceVertexAlphaData property to be the same as Vertices(:,2)
'z' - set the FaceVertexAlphaData property to be the same as Vertices(:,3)
'color' - set the FaceVertexAlphaData property to be the same as FaceVertexCData
'rand' - set the FaceVertexAlphaData property to random values
See Mapping Data to Transparency for more information.
AlphaDataMapping
alpha(alpha_data_mapping)
sets the AlphaDataMapping property of all image, patch, and surface objects in the current axes. You can set alpha_data_mapping to:
'scaled' - set the AlphaDataMapping property to scaled
'direct' - set the AlphaDataMapping property to direct
'none' - set the AlphaDataMapping property to none
alpha(object_handle,value)
set the transparency property only on the object identified by object_handle
See Also
Image: AlphaData, AlphaDataMapping
Patch: FaceAlpha, FaceVertexAlphaData, AlphaDataMapping
Surface: FaceAlpha, AlphaData, AlphaDataMapping
Transparency for related functions
Transparency in 3-D Visualization for examples
| allchild | alphamap | ![]() |