Skip to Main Content Skip to Search
Product Documentation

alphamap - Specify figure alphamap (transparency)

Syntax

alphamap(alpha_map)
alphamap('parameter')
alphamap('parameter',length)
alphamap('parameter',delta)
alphamap(figure_handle,...)
alpha_map = alphamap
alpha_map = alphamap(figure_handle)
alpha_map = alphamap('parameter')

Description

alphamap(alpha_map) sets the AlphaMap of the current figure to the specified m-by-1 array of alpha values, alpha_map.

alphamap('parameter') creates a new alphamap or modifies the current alphamap. You can specify the following parameters:

alphamap('parameter',length) creates a new alphamap with the length specified by the integer length (used with parameters 'rampup', 'rampdown', 'vup', 'vdown').

alphamap('parameter',delta) modifies the existing alphamap using the value specified by the integer delta (used with parameters 'increase', 'decrease', 'spin').

alphamap(figure_handle,...) performs the operation on the alphamap of the figure identified by figure_handle.

alpha_map = alphamap returns the current alphamap.

alpha_map = alphamap(figure_handle) returns the current alphamap from the figure identified by figure_handle.

alpha_map = alphamap('parameter') returns the alphamap modified by the parameter, but does not set the AlphaMap property.

Examples

Create a surface plot and change the alphamap

[x,y] = meshgrid([-2:.2:2]);
z = x.*exp(-x.^2-y.^2);
% Plot the data, using the gradient of z as
% the alphamap:
surf(x,y,z+.001,'FaceAlpha','flat',...
'AlphaDataMapping','scaled',...
'AlphaData',gradient(z),...
'FaceColor','blue');
% Change the alphamap to be opaque at the middle and
% transparent towards the ends:
alphamap('vup')

See Also

alim | alpha | Image: AlphaData | Image: AlphaDataMapping | Patch: AlphaDataMapping | Patch: FaceAlpha | Patch: FaceVertexAlphaData | Surface: AlphaData | Surface: AlphaDataMapping | Surface: FaceAlpha

Tutorials

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS