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 theAlphaData
property to the specified value) 'flat'
- set theFaceAlpha
property toflat
'interp'
- set theFaceAlpha
property tointerp
'texture'
- set theFaceAlpha
property totexture
'opaque'
- set theFaceAlpha
property to1
'clear'
- set theFaceAlpha
property to0
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 theAlphaData
property to the specified values 'x'
- set theAlphaData
property to be the same asXData
'y'
- set theAlphaData
property to be the same asYData
'z'
- set theAlphaData
property to be the same asZData
'color'
- set theAlphaData
property to be the same asCData
'rand'
- set theAlphaData
property to a matrix of random values equal in size toCData
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 theAlphaData
property to the specified value 'x'
- ignored'y'
- ignored'z'
- ignored'color'
- set theAlphaData
property to be the same asCData
'rand'
- set theAlphaData
property to a matrix of random values equal in size toCData
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 theFaceVertexAlphaData
property to the specified value 'x'
- set theFaceVertexAlphaData
property to be the same asVertices(:,1)
'y'
- set theFaceVertexAlphaData
property to be the same asVertices(:,2)
'z'
- set theFaceVertexAlphaData
property to be the same asVertices(:,3)
'color'
- set theFaceVertexAlphaData
property to be the same asFaceVertexCData
'rand'
- set theFaceVertexAlphaData
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 theAlphaDataMapping
property toscaled
'direct'
- set theAlphaDataMapping
property todirect
'none'
- set theAlphaDataMapping
property tonone
alpha(object_handle,value)
set the transparency property only on the object identified by object_handle
No comments:
Post a Comment