Surface Properties
Primitive surface appearance and behavior
Surface
properties control the appearance and behavior ofSurface
objects. By changing property values, you can modify certain aspects of the surface chart.
Starting in R2014b, you can use dot notation to query and set properties.
s = surface; c = s.CData; s.CDataMapping = 'direct';
If you are using an earlier release, use theget
andset
functions instead.
Faces
FaceColor
—Face color
'flat'
(default) |'interp'
|'none'
|'texturemap'
|RGB triplet|'r'
|'g'
|'b'
| ...
Face color, specified as one of the values in this table.
Value | Description |
---|---|
'flat' |
Use a different color for each face based on the values in the |
'interp' |
Use interpolated coloring for each face based on the values in the |
RGB triplet or color name | Use the specified color for all the faces. This option does not use the color values in the |
'texturemap' |
Transform the color data inCData so that it conforms to the surface. |
'none' |
Do not draw the faces. |
An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range[0,1]
; for example,[0.4 0.6 0.7]
. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.
Option | Description | Equivalent RGB Triplet |
---|---|---|
'red' or'r' |
Red | [1 0 0] |
'green' or'g' |
Green | [0 1 0] |
'blue' or'b' |
Blue | [0 0 1] |
'yellow' or'y' |
Yellow | [1 1 0] |
'magenta' or'm' |
Magenta | [1 0 1] |
'cyan' or'c' |
Cyan | [0 1 1] |
'white' or'w' |
White | [1 1 1] |
'black' or'k' |
Black | [0 0 0] |
FaceAlpha
—Face transparency
1(default) |scalar in range[0,1]
|'flat'
|'interp'
|'texturemap'
Face transparency, specified as one of these values:
Scalar in range
[0,1]
— Use uniform transparency across all the faces. A value of1
is fully opaque and0
is completely transparent. Values between0
and1
are semitransparent. This option does not use the transparency values in theAlphaData
property.'flat'
— Use a different transparency for each face based on the values in theAlphaData
property. The transparency value at the first vertex determines the transparency for the entire face. First you must specify theAlphaData
property as a matrix the same size as theZData
property. TheFaceColor
property also must be set to'flat'
.'interp'
— Use interpolated transparency for each face based on the values inAlphaData
property. The transparency varies across each face by interpolating the values at the vertices. First you must specify theAlphaData
property as a matrix the same size as theZData
property. TheFaceColor
property also must be set to'interp'
.'texturemap'
— Transform the data inAlphaData
so that it conforms to the surface.
FaceLighting
—Effect of light objects on faces
'flat'
(default) |'gouraud'
|'none'
Effect of light objects on faces, specified as one of these values:
'flat'
— Apply light uniformly across each face. Use this value to view faceted objects.'gouraud'
— Vary the light across the faces. Calculate the light at the vertices and then linearly interpolate the light across the faces. Use this value to view curved surfaces.'none'
— Do not apply light from light objects to the faces.
To add a light object to the axes, use thelight
function.
Note
The'phong'
value has been removed. Use'gouraud'
instead.
BackFaceLighting
—Face lighting when normals point away from camera
'reverselit'
(default) |'unlit'
|'lit'
Face lighting when the vertex normals point away from camera, specified as one of these values:
'reverselit'
— Light the face as if the vertex normal pointed towards the camera.'unlit'
— Do not light the face.'lit'
— Light the face according to the vertex normal.
Use this property to discriminate between the internal and external surfaces of an object. For an example, seeBack Face Lighting.
Edges
MeshStyle
—Edges to display
'both'
(default) |'row'
|'column'
Edges to display, specified as'both'
,'row'
, or'column'
.
EdgeColor
—Edge line color
[0 0 0]
(default) |'none'
|'flat'
|'interp'
|RGB triplet|'r'
|'g'
|'b'
| ...
Edge line color, specified as one of the values listed here. The default color of[0 0 0]
corresponds to black edges.
Value | Description |
---|---|
'none' |
Do not draw the edges. |
'flat' |
Use a different color for each edge based on the values in the |
'interp' |
基于t使用插值为每个边缘着色he values in the |
RGB triplet or color name | Use the specified color for all the edges. This option does not use the color values in the |
An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range[0,1]
; for example,[0.4 0.6 0.7]
. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.
Option | Description | Equivalent RGB Triplet |
---|---|---|
'red' or'r' |
Red | [1 0 0] |
'green' or'g' |
Green | [0 1 0] |
'blue' or'b' |
Blue | [0 0 1] |
'yellow' or'y' |
Yellow | [1 1 0] |
'magenta' or'm' |
Magenta | [1 0 1] |
'cyan' or'c' |
Cyan | [0 1 1] |
'white' or'w' |
White | [1 1 1] |
'black' or'k' |
Black | [0 0 0] |
EdgeAlpha
—Edge transparency
1(default) |scalar value in range[0,1]
|'flat'
|'interp'
Edge transparency, specified as one of these values:
Scalar in range
[0,1]
— Use uniform transparency across all of the edges. A value of1
is fully opaque and0
is completely transparent. Values between0
and1
are semitransparent. This option does not use the transparency values in theAlphaData
property.'flat'
— Use a different transparency for each edge based on the values in theAlphaData
property. First you must specify theAlphaData
property as a matrix the same size as theZData
property. The transparency value at the first vertex determines the transparency for the entire edge. TheEdgeColor
property also must be set to'flat'
.'interp'
— Use interpolated transparency for each edge based on the values inAlphaData
property. First you must specify theAlphaData
property as a matrix the same size as theZData
property. The transparency varies across each edge by interpolating the values at the vertices. TheEdgeColor
property also must be set to'interp'
.
LineStyle
—Line style
“- - -”
(default) |'--'
|':'
|'-.'
|'none'
Line style, specified as one of the options listed in this table.
Line Style | Description | Resulting Line |
---|---|---|
“- - -” |
Solid line |
|
'--' |
Dashed line |
|
':' |
Dotted line |
|
'-.' |
Dash-dotted line |
|
'none' |
No line | No line |
LineWidth
—Line width
0.5
(default) |positive value
Line width, specified as a positive value in points. If the line has markers, then the line width also affects the marker edges.
Example:0.75
AlignVertexCenters
—Sharp vertical and horizontal lines
'off'
(default) |'on'
Sharp vertical and horizontal lines, specified as'off'
or'on'
.
If the associated figure has aGraphicsSmoothing
property set to'on'
and aRenderer
property set to'opengl'
, then the figure applies a smoothing technique to plots. In some cases, this smoothing technique can cause vertical and horizontal lines to appear uneven in thickness or color. Use theAlignVertexCenters
property to eliminate the uneven appearance.
'off'
— Do not sharpen vertical or horizontal lines. The lines might appear uneven in thickness or color.'on'
— Sharpen vertical and horizontal lines to eliminate an uneven appearance.
Note
You must have a graphics card that supports this feature. To see if the feature is supported, typeopengl info
. If it is supported, then the returned fields contain the lineSupportsAlignVertexCenters: 1
.
EdgeLighting
—Effect of light objects on edges
'none'
(default) |'flat'
|'gouraud'
Effect of light objects on edges, specified as one of these values:
'flat'
— Apply light uniformly across the each edges.'none'
— Do not apply lights from light objects to the edges.'gouraud'
— Calculate the light at the vertices, and then linearly interpolate across the edges.
Note
The'phong'
value has been removed. Use'gouraud'
instead.
Markers
Marker
—Marker symbol
'none'
(default) |'o'
|'+'
|'*'
|'.'
|...
Marker symbol, specified as one of the values listed in this table. By default, the object does not display markers. Specifying a marker symbol adds markers at each data point or vertex.
Value | Description |
---|---|
'o' |
Circle |
'+' |
Plus sign |
'*' |
Asterisk |
'.' |
Point |
'x' |
Cross |
'square' or's' |
Square |
'diamond' or'd' |
Diamond |
'^' |
Upward-pointing triangle |
'v' |
Downward-pointing triangle |
'>' |
Right-pointing triangle |
'<' |
Left-pointing triangle |
'pentagram' or'p' |
Five-pointed star (pentagram) |
'hexagram' or'h' |
Six-pointed star (hexagram) |
'none' |
No markers |
MarkerSize
—Marker size
6
(default) |positive value
Marker size, specified as a positive value in points.
Example:10
MarkerEdgeColor
—Marker outline color
'auto'
(default) |'flat'
|RGB triplet|'r'
|'g'
|'b'
Marker outline color, specified as'auto'
,'flat'
, an RGB triplet, or one of the color options listed in the table.
'auto'
— Use the same color as theEdgeColor
property.'flat'
— Use theCData
value at the vertex to set the color.
For a custom color, specify an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range[0,1]
; for example,[0.4 0.6 0.7]
. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.
Option | Description | Equivalent RGB Triplet |
---|---|---|
'red' or'r' |
Red | [1 0 0] |
'green' or'g' |
Green | [0 1 0] |
'blue' or'b' |
Blue | [0 0 1] |
'yellow' or'y' |
Yellow | [1 1 0] |
'magenta' or'm' |
Magenta | [1 0 1] |
'cyan' or'c' |
Cyan | [0 1 1] |
'white' or'w' |
White | [1 1 1] |
'black' or'k' |
Black | [0 0 0] |
'none' |
No color | Not applicable |
MarkerFaceColor
—Marker fill color
'none'
(default) |'auto'
|'flat'
|RGB triplet|'r'
|'g'
|'b'
| ...
Marker fill color, specified as'auto'
,'flat'
, an RGB triplet, or one of the color options listed in the table.
'auto'
— Use the same color as theColor
property for the axes.'flat'
— Use theCData
value of the vertex to set the color.
For a custom color, specify an RGB triplet. An RGB triplet is a three-element row vector whose elements specify the intensities of the red, green, and blue components of the color. The intensities must be in the range[0,1]
; for example,[0.4 0.6 0.7]
. Alternatively, you can specify some common colors by name. This table lists the long and short color name options and the equivalent RGB triplet values.
Option | Description | Equivalent RGB Triplet |
---|---|---|
'red' or'r' |
Red | [1 0 0] |
'green' or'g' |
Green | [0 1 0] |
'blue' or'b' |
Blue | [0 0 1] |
'yellow' or'y' |
Yellow | [1 1 0] |
'magenta' or'm' |
Magenta | [1 0 1] |
'cyan' or'c' |
Cyan | [0 1 1] |
'white' or'w' |
White | [1 1 1] |
'black' or'k' |
Black | [0 0 0] |
'none' |
No color | Not applicable |
This property affects only the circle, square, diamond, pentagram, hexagram, and the four triangle marker types.
Example:[0.3 0.2 0.1]
Example:'green'
Coordinate Data
XData
—x-coordinate data
vector or matrix
x-coordinate data specified as a matrix that is the same size asZData
or a vector oflength(n)
, where[m,n] = size(ZData)
.
Data Types:single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
|categorical
|datetime
|duration
XDataMode
—Selection mode forXData
'auto'
|'manual'
Selection mode forXData
, specified as one of these values:
'auto'
— Use the column indices ofZData
.'manual'
— Use manually specified value. To specify the value, pass an input argument to the plotting function or directly set theXData
property.
YData
—y-coordinate data
vector or matrix
y-coordinate data specified as a matrix that is the same size asZData
or a vector oflength(m)
, where[m,n] = size(ZData)
.
Data Types:single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
|categorical
|datetime
|duration
YDataMode
—Selection mode forYData
'auto'
|'manual'
Selection mode forYData
, specified as one of these values:
'auto'
— Use the row indices ofZData
.'manual'
— Use manually specified value. To specify the value, pass an input argument to the plotting function or directly set theYData
property.
ZData
—z-coordinate data
matrix
z-coordinate data specified as a matrix.
Data Types:single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
|categorical
|datetime
|duration
Color and Transparency Data
CData
—Vertex colors
2-D or 3-D array
Vertex colors, specified in one of these forms:
2-D array — Use colormap colors. Specify a color for each vertex by setting
CData
to an array the same size asZData
. TheCDataMapping
property determines how these values map into the current colormap. If theFaceColor
property is set to'texturemap'
, thenCData
does not need to be the same size asZData
. However, it must be of typedouble
oruint8
. TheCData
values map to conform to the surface defined byZData
.三维数组,使用真正的颜色。指定一个RGB triplet color for each vertex by setting
CData
to an m-by-n-by-3 array where[m,n] = size(ZData)
. An RGB triplet is a three-element vector that specifies the intensities of the red, green, and blue components of a color. The first page of the array contains the red components, the second the green components, and the third the blue components of the colors. Since the surface uses true colors instead of colormap colors, theCDataMapping
property has no effect.If
CData
is of typedouble
orsingle
, then an RGB triplet value of[0 0 0]
corresponds to black and[1 1 1]
corresponds to white.If
CData
is an integer type, then the surface uses the full range of data to determine the color. For example, ifCData
is of typeuint8
, then[0 0 0]
corresponds to black and[255 255 255]
corresponds to white. IfCData
is of typeint8
, then[-128 -128 -128]
corresponds to black and[127 127 127]
corresponds to white.
Data Types:single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
CDataMode
—Selection mode forCData
'auto'
(default) |'manual'
Selection mode forCData
, specified as one of these values:
'auto'
— Use theZData
values to set the colors.'manual'
— Use manually specified values. To specify the values, set theCData
property.
CDataMapping
—Direct or scaled colormapping
'scaled'
(default) |'direct'
Direct or scaled colormapping, specified as one of these values:
scaled
— Transform the color data to span the portion of the colormap indicated by the axesCLim
property, linearly mapping data values to colors. See thecaxis
reference page for more information on this mapping.direct
— Use the color data as indices directly into the colormap. The color data should then be integer values ranging from 1 tolength(colormap)
. MATLAB®maps values less than 1 to the first color in the colormap, and values greater thanlength(colormap)
to the last color in the colormap. Values with a decimal portion are fixed to the nearest lower integer.
AlphaData
—Transparency data
1(default) |array same size asZData
Transparency data for each vertex, specified as an array the same size as theZData
property. After specifying the values, set theFaceAlpha
andEdgeAlpha
properties to control the type of transparency. If theFaceAlpha
andEdgeAlpha
properties are both set to scalar values, then the surface does not use theAlphaData
values.
TheAlphaDataMapping
property determines how the surface interprets theAlphaData
property values.
Data Types:single
|double
|int8
|int16
|int32
|int64
|uint8
|uint16
|uint32
|uint64
|logical
AlphaDataMapping
—Interpretation ofAlphaData
values
'scaled'
(default) |'direct'
|'none'
Interpretation ofAlphaData
values, specified as one of these values:
'none'
— Interpret the values as transparency values. A value of 1 or greater is completely opaque, a value of 0 or less is completely transparent, and a value between 0 and 1 is semitransparent.'scaled'
— Map the values into the figure’s alphamap. The minimum and maximum alpha limits of the axes determine theAlphaData
values that map to the first and last elements in the alphamap, respectively. For example, if the alpha limits are[3 5]
, then values of3
or less map to the first element in the alphamap. Values of5
or greater map to the last element in the alphamap. TheALim
property of the axes contains the alpha limits. TheAlphamap
property of the figure contains the alphamap.'direct'
— Interpret the values as indices into the figure’s alphamap. Values with a decimal portion are fixed to the nearest lower integer.If the values are of type
double
orsingle
, then values of 1 or less map to the first element in the alphamap. Values equal to or greater than the length of the alphamap map to the last element in the alphamap.如果整数类型的值,值的0 or less map to the first element in the alphamap. Values equal to or greater than the length of the alphamap map to the last element in the alphamap (or up to the range limits of the type). The integer types are
uint8
,uint16
,uint32
,uint64
,int8
,int16
,int32
, andint64
.If the values are of type
logical
, then values of 0 map to the first element in the alphamap and values of 1 map to the second element in the alphamap.
Normals
VertexNormals
—Normal vectors for each surface vertex
[]
(default) |m-by-n-by-3 array
Normal vectors for each surface vertex, specified as a m-by-n-by-3 array, where[m,n] = size(ZData)
. Specify one normal vector per vertex.
这个属性集assoc指定值iated mode to manual. If you do not specify normal vectors, then the surface generates this data for lighting calculations.
Data Types:single
|double
VertexNormalsMode
—Selection mode forVertexNormals
'auto'
(default) |'manual'
Selection mode forVertexNormals
, specified as one of these values:
'auto'
— Calculate the normal vectors based on the coordinate data.'manual'
— Use manually specified values. To specify the values, set theVertexNormals
property.
FaceNormals
—Normal vectors for each surface face
[]
(default) |(m-1)-by-(n-1)-by-3 array
Normal vectors for each surface face, specified as a (m-1)-by-(n-1)-by-3 array, where[m,n] = size(ZData)
. Specify one normal vector per face.
这个属性集assoc指定值iated mode to manual. If you do not specify normal vectors, then the surface generates this data for lighting calculations.
Data Types:single
|double
FaceNormalsMode
—Selection mode forFaceNormals
'auto'
(default) |'manual'
Selection mode forFaceNormals
, specified as one of these values:
'auto'
— Calculate the normal vectors based on the coordinate data.'manual'
— Use manually specified values. To specify the values, set theFaceNormals
property.
Lighting
AmbientStrength
—Strength of ambient light
0.3
(default) |scalar in range[0,1]
Strength of ambient light, specified as a scalar value in the range[0,1]
. Ambient light is a nondirectional light that illuminates the entire scene. There must be at least one visible light object in the axes for the ambient light to be visible.
TheAmbientLightColor
property for the axes sets the color of the ambient light. The color is the same for all objects in the axes.
Example:0.5
Data Types:double
DiffuseStrength
—Strength of diffuse light
0.6
(default) |scalar in range[0,1]
Strength of diffuse light, specified as a scalar value in the range[0,1]
. Diffuse light is the nonspecular reflectance from light objects in the axes.
Example:0.3
Data Types:double
SpecularStrength
—Strength of specular reflection
0.9
(default) |scalar in range[0,1]
Strength of specular reflection, specified as a scalar value in the range[0,1]
. Specular reflections are the bright spots on the surface from light objects in the axes.
Example:0.3
Data Types:double
SpecularExponent
—Size of specular spot
10(default) |scalar greater than or equal to 1
Size of specular spot, specified as a scalar value greater than or equal to 1. Most materials have exponents in the range[5 20]
.
Example:7
Data Types:double
SpecularColorReflectance
—Color of specular reflections
1(default) |scalar in range[0,1]
Color of specular reflections, specified as a scalar value in the range[0,1]
. A value of1
sets the color using only the color of the light source. A value of0
sets the color using both the color of the object from which it reflects and the color of the light source. TheColor
property of the light contains the color of the light source. The proportions vary linearly for values in between.
Example:0.5
Data Types:double
Legend
DisplayName
—Legend label
''
(default) |character vector|string
Legend label, specified as a character vector or string. If you do not specify the text, then the legend uses a label of the form'dataN'
. The legend does not display until you call thelegend
command.
Example:'Label Text'
Data Types:char
|string
Annotation
—Control for including or excluding object from legend
Annotation
object
This property is read-only.
Control for including or excluding the object from a legend, returned as anAnnotation
object. Set the underlyingIconDisplayStyle
property to one of these values:
'on'
— Include the object in the legend (default).'off'
— Do not include the object in the legend.
For example, exclude a stem chart from the legend.
p = plot(1:10,'DisplayName','Line Chart'); holdons = stem(1:10,'DisplayName','Stem Chart'); holdoffs.Annotation.LegendInformation.IconDisplayStyle ='off'; legend('show')
Alternatively, you can control the items in a legend using thelegend
function. Specify the first input argument as a vector of the graphics objects to include.
p = plot(1:10,'DisplayName','Line Chart'); holdons = stem(1:10,'DisplayName','Stem Chart'); holdofflegend(p)
Interactivity
Visible
—State of visibility
'on'
(default) |'off'
State of visibility, specified as one of these values:
'on'
— Display the object.'off'
— Hide the object without deleting it. You still can access the properties of an invisible object.
UIContextMenu
—Context menu
uicontextmenu object
Context menu, specified as aContextMenu
object. Use this property to display a context menu when you right-click the object. Create the context menu using theuicontextmenu
function.
Note
If thePickableParts
property is set to'none'
or if theHitTest
property is set to'off'
, then the context menu does not appear.
Selected
—Selection state
'off'
(default) |'on'
Selection state, specified as one of these values:
'on'
— Selected. If you click the object when in plot edit mode, then MATLAB sets itsSelected
property to'on'
. If theSelectionHighlight
property also is set to'on'
, then MATLAB displays selection handles around the object.'off'
— Not selected.
SelectionHighlight
—Display of selection handles
'on'
(default) |'off'
Display of selection handles when selected, specified as one of these values:
'on'
— Display selection handles when theSelected
property is set to'on'
.'off'
— Never display selection handles, even when theSelected
property is set to'on'
.
Clipping
—Clipping of object to axes limits
'on'
(default) |'off'
Clipping of the object to the axes limits, specified as one of these values:
'on'
— Do not display parts of the object that are outside the axes limits.'off'
— Display the entire object, even if parts of it appear outside the axes limits. Parts of the object might appear outside the axes limits if you create a plot, sethold on
, freeze the axis scaling, and then create the object so that it is larger than the original plot.
TheClipping
property of the axes that contains the object must be set to'on'
. Otherwise, this property has no effect. For more information about the clipping behavior, see theClipping
property of the axes.
Callbacks
ButtonDownFcn
—Mouse-click callback
''
(default) |function handle|cell array|character vector
Mouse-click callback, specified as one of these values:
Function handle
Cell array containing a function handle and additional arguments
Character vector that is a valid MATLAB command or function, which is evaluated in the base workspace (not recommended)
使用这个属性来执行鳕鱼e when you click the object. If you specify this property using a function handle, then MATLAB passes two arguments to the callback function when executing the callback:
Clicked object — Access properties of the clicked object from within the callback function.
Event data — Empty argument. Replace it with the tilde character (
~
) in the function definition to indicate that this argument is not used.
For more information on how to use function handles to define callback functions, seeCallback Definition.
Note
If thePickableParts
property is set to'none'
or if theHitTest
property is set to'off'
, then this callback does not execute.
CreateFcn
—Creation callback
''
(default) |function handle|cell array|character vector
Creation callback, specified as one of these values:
Function handle
Cell array containing a function handle and additional arguments
Character vector that is a valid MATLAB command or function, which is evaluated in the base workspace (not recommended)
使用这个属性来执行鳕鱼e when you create the object. MATLAB executes the callback after creating the object and setting all of its properties. Setting theCreateFcn
property on an existing object has no effect. To have an effect, you must specify theCreateFcn
property during object creation. One way to specify the property during object creation is to set the default property value for the object. SeeDefault Property Valuesfor more information.
If you specify this callback using a function handle, then MATLAB passes two arguments to the callback function when executing the callback:
Created object — Access properties of the object from within the callback function. You also can access the object through the
CallbackObject
property of the root, which can be queried using thegcbo
function.Event data — Empty argument. Replace it with the tilde character (
~
) in the function definition to indicate that this argument is not used.
For more information on how to use function handles to define callback functions, seeCallback Definition.
DeleteFcn
—Deletion callback
''
(default) |function handle|cell array|character vector
删除回调,指定为一个值s:
Function handle
Cell array containing a function handle and additional arguments
Character vector that is a valid MATLAB command or function, which is evaluated in the base workspace (not recommended)
使用这个属性来执行鳕鱼e when you delete the object MATLAB executes the callback before destroying the object so that the callback can access its property values.
If you specify this callback using a function handle, then MATLAB passes two arguments to the callback function when executing the callback:
Deleted object — Access properties of the object from within the callback function. You also can access the object through the
CallbackObject
property of the root, which can be queried using thegcbo
function.Event data — Empty argument. Replace it with the tilde character (
~
) in the function definition to indicate that this argument is not used.
For more information on how to use function handles to define callback functions, seeCallback Definition.
Callback Execution Control
BusyAction
—Callback queuing
'queue'
(default) |'cancel'
Callback queuing specified as'queue'
or'cancel'
. TheBusyAction
property determines how MATLAB handles the execution of interrupting callbacks.
Consider these callback states where:
Therunningcallback is the currently executing callback.
Theinterruptingcallback is a callback that tries to interrupt the running callback.
Whenever MATLAB invokes a callback, that callback attempts to interrupt a running callback. TheInterruptible
property of the object owning the running callback determines if interruption is permitted. If interruption is not permitted, then theBusyAction
property of the object owning the interrupting callback determines if it is discarded or put in the queue.
If a callback of theSurface
object tries to interrupt a running callback that cannot be interrupted, then theBusyAction
property determines if it is discarded or put in the queue. Specify theBusyAction
property as one of these values:
'queue'
— Put the interrupting callback in a queue to be processed after the running callback finishes execution. (default behavior)'cancel'
— Discard the interrupting callback.
Interruptible
—Callback interruption
'on'
(default) |'off'
Callback interruption, specified as'on'
or'off'
. TheInterruptible
property determines if a running callback can be interrupted.
Note
Consider these callback states where:
Therunningcallback is the currently executing callback.
Theinterruptingcallback is a callback that tries to interrupt the running callback.
Whenever MATLAB invokes a callback, that callback attempts to interrupt a running callback. TheInterruptible
property of the object owning the running callback determines if interruption is permitted. If interruption is not permitted, then theBusyAction
property of the object owning the interrupting callback determines if it is discarded or put in the queue.
TheInterruptible
property determines if another callback can interrupt theButtonDownFcn
callback of theSurface
object. TheInterruptible
property has two values:
'on'
— Interruptible. Interruption occurs at the next point where MATLAB processes the queue. For example, when you have a command such asdrawnow
,figure
,getframe
,waitfor
, orpause
.If the running callback contains one of these commands, then MATLAB stops the execution of the callback at this point and executes the interrupting callback. MATLAB resumes executing the running callback when the interrupting callback completes. For more information, seeInterrupt Callback Execution.
If the running callback does not contain one of these commands, then MATLAB finishes executing the callback without interruption.
'off'
— Not interruptible. MATLAB finishes executing the running callback without any interruptions.
PickableParts
—Ability to capture mouse clicks
'visible'
(default) |'all'
|'none'
Ability to capture mouse clicks, specified as one of these values:
'visible'
— Capture mouse clicks when visible. TheVisible
property must be set to'on'
and you must click a part of theSurface
object that has a defined color. You cannot click a part that has an associated color property set to'none'
. If the plot contains markers, then the entire marker is clickable if either the edge or the fill has a defined color. TheHitTest
property determines if theSurface
object responds to the click or if an ancestor does.'all'
— Capture mouse clicks regardless of visibility. TheVisible
property can be set to'on'
or'off'
and you can click a part of theSurface
object that has no color. TheHitTest
property determines if theSurface
object responds to the click or if an ancestor does.'none'
— Cannot capture mouse clicks. Clicking theSurface
object passes the click through it to the object below it in the current view of the figure window. TheHitTest
property has no effect.
HitTest
—Response to captured mouse clicks
'on'
(default) |'off'
Response to captured mouse clicks, specified as one of these values:
'on'
— Trigger theButtonDownFcn
callback of theSurface
object. If you have defined theUIContextMenu
property, then invoke the context menu.'off'
— Trigger the callbacks for the nearest ancestor of theSurface
object that has:HitTest
property set to'on'
PickableParts
property set to a value that enables the ancestor to capture mouse clicks.
Note
ThePickableParts
property determines if theSurface
object can capture mouse clicks. If it cannot, then theHitTest
property has no effect.
BeingDeleted
—Deletion status
'off'
|'on'
This property is read-only.
Deletion status, returned as'off'
or'on'
. MATLAB sets theBeingDeleted
property to'on'
when the delete function of the object begins execution (see theDeleteFcn
property). TheBeingDeleted
property remains set to'on'
until the object no longer exists.
Check the value of theBeingDeleted
property if you need to verify that the object is not about to be deleted before querying or modifying it.
Parent/Child
Parent
—Parent
Axes
object|Group
object|Transform
object
Parent, specified as anAxes
,Group
, orTransform
object.
HandleVisibility
—Visibility of object handle
'on'
(default) |'off'
|'callback'
Visibility of the object handle in theChildren
property of the parent, specified as one of these values:
'on'
— Object handle is always visible.'off'
— Object handle is invisible at all times. This option is useful for preventing unintended changes to the UI by another function. Set theHandleVisibility
to'off'
to temporarily hide the handle during the execution of that function.'callback'
— Object handle is visible from within callbacks or functions invoked by callbacks, but not from within functions invoked from the command line. This option blocks access to the object at the command line, but permits callback functions to access it.
If the object is not listed in theChildren
property of the parent, then functions that obtain object handles by searching the object hierarchy or querying handle properties cannot return it. For example, when you have a function such asget
,findobj
,gca
,gcf
,gco
,newplot
,cla
,clf
, andclose
.
Hidden object handles are still valid. Set the rootShowHiddenHandles
property to'on'
to list all object handles regardless of theirHandleVisibility
property setting.
Children
—Children
emptyGraphicsPlaceholder
array
The object has no children. You cannot set this property.
Identifiers
Tag
—User-specified tag
''
(default) |character vector|string scalar
Tag to associate with thesurface
object, specified as a character vector or string scalar.
Use this property to findsurface
objects in a hierarchy. For example, you can use thefindobj
function to findsurface
objects that have a specificTag
property value.
Example:'January Data'
Type
—Type of graphics object
'surface'
This property is read-only.
Type of graphics object, returned as'surface'
UserData
—User data
[]
(default) |any MATLAB data
User data to associate with thesurface
object, specified as any MATLAB data, for example, a scalar, vector, matrix, cell array, character array, table, or structure. MATLAB does not use this data.
To associate multiple sets of data or to attach a field name to the data, use thegetappdata
andsetappdata
functions.
Example:1:100
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)