Set or query the axes alpha limits
Syntax
Description
alpha_limits = alim
returns the alpha limits (the axes ALim
property) of the current axes.
alim([amin amax])
sets the alpha limits to the specified values. amin
is the value of the data mapped to the first alpha value in the alphamap, and amax
is the value of the data mapped to the last alpha value in the alphamap. Data values in between are linearly interpolated across the alphamap, while data values outside are clamped to either the first or last alphamap value, whichever is closest.
alim_mode = alim('mode')
returns the alpha limits mode (the axes ALimMode
property) of the current axes.
alim('alim_mode')
sets the alpha limits mode on the current axes. alim_mode
can be:
- auto - MATLAB automatically sets the alpha limits based on the alpha data of the objects in the axes.
manual
- MATLAB does not change the alpha limits.
alim(axes_handle,...)
operates on the specified axes.
Test to determine if all elements are nonzero
Syntax
Description
B = all(A)
tests whether all the elements along various dimensions of an array are nonzero or logical true (1
).
If A
is a vector, all(A)
returns logical true (1
) if all of the elements are nonzero, and returns logical false (0
) if one or more elements are zero.
If A
is a matrix, all(A)
treats the columns of A
as vectors, returning a row vector of 1
s and 0
s.
If A
is a multidimensional array, all(A)
treats the values along the first non-singleton dimension as vectors, returning a logical condition for each vector.
B = all(A,
tests along the dimension of dim
) A
specified by scalar dim
.
Examples
then B = (A <> returns logical true (
1
) only where A
is less than one half:
The all
function reduces such a vector of logical conditions to a single condition. In this case, all(B) yields 0
.
This makes all
particularly useful in if
statements,
where code is executed depending on a single condition, not a vector of possibly conflicting conditions.
Applying the all
function twice to a matrix, as in all(all(A))
, always reduces it to a scalar condition.
allchild
Find all children of specified objects
Syntax
Description
child_handles = allchild(handle_list)
returns the list of all children (including ones with hidden handles) for each handle. If handle_list
is a single element, allchild returns the output in a vector. Otherwise, the output is a cell array.
Examples
Compare the results returned by these two statements.
alpha
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:
- a scalar - set the
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:
- a matrix the same size as
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:
- a matrix the same size as
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:
- a matrix the same size as
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
No comments:
Post a Comment