CartesianAxesInteractionOptions Properties
CartesianAxesInteractionOptions
properties control the behavior
of axes interactions for apps. By changing property values, you can customize the behavior of
all associated axes interactions. Use dot notation to query and set properties.
f = uifigure; ax = uiaxes(f); ax.InteractionOptions.LimitsDimensions = "x";
The options set by the CartesianAxesInteractionOptions
object apply to
these interactions on the associated axes:
The built-in interactions specified by the
Interactions
property of the axesInteractions enabled by using mode functions, such as
pan
andzoom
Interactions enabled using the axes toolbar
The properties listed here are valid for axes in App
Designer and for axes in figures created with the uifigure
function.
Bounding Limits
LimitsDimensions
— Pan and zoom dimension constraint
"xyz"
(default) | "x"
| "y"
| "z"
| "xy"
| "xz"
| "yz"
Pan and zoom dimension constraint, specified as one of the values in this table.
Value | Description |
---|---|
"xyz" | Constrain pan and zoom interactions to the x-, y-, and z-dimensions. |
"x" | Constrain pan and zoom interactions to the x-dimension. |
"y" | Constrain pan and zoom interactions to the y-dimension. |
"z" | Constrain pan and zoom interactions to the z-dimension. |
"xy" | Constrain pan and zoom interactions to the x- and y-dimensions. |
"xz" | Constrain pan and zoom interactions to the x- and z-dimensions. |
"yz" | Constrain pan and zoom interactions to the y- and z-dimensions. |
Example: ax.InteractionOptions.LimitsDimensions = "x"
PanLimitsBounded
— Bounded pan indicator
"off"
(default) | on/off logical value
Bounded pan indicator, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A value
of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can use
the value of this property as a logical value. The value is stored as an on/off logical
value of type matlab.lang.OnOffSwitchState
.
If PanLimitsBounded
is "on"
, the pan
interaction is bounded by the minimum and maximum limit values specified in the
OuterXLimits
, OuterYLimits
, and
OuterZLimits
properties.
If the axes contains an image, then the default value of
PanLimitsBounded
is "on"
. Otherwise, the
default value is "off"
.
Example:
ax.InteractionOptions.PanLimitsBounded = "on"
ZoomLimitsBounded
— Bounded zoom indicator
"on"
(default) | on/off logical value
Bounded zoom indicator, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A value
of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can use
the value of this property as a logical value. The value is stored as an on/off logical
value of type matlab.lang.OnOffSwitchState
.
If ZoomLimitsBounded
is "off"
, the zoom
interaction is not bounded by the minimum and maximum limit values specified in the
OuterXLimits
, OuterYLimits
, and
OuterZLimits
properties.
Example:
ax.InteractionOptions.ZoomLimitsBounded = "off"
OuterXLimits
, OuterYLimits
, OuterZLimits
— Minimum and maximum pan and zoom limits
[0 0]
(default) | two-element vector of form [min max]
Minimum and maximum pan and zoom limits, specified as a two-element vector of the
form [min max]
, where max
is greater than
min
. You can specify the limits as numeric, categorical, datetime,
or duration values. However, the type of values that you specify must match the type of
values along the corresponding axis.
You can specify both limits, or specify one limit and let MATLAB^{®} automatically calculate the other. For an automatically calculated minimum
or maximum limit, use -Inf
or Inf
, respectively.
MATLAB uses the "tight"
limit method to calculate the
corresponding limit.
Example:
ax.InteractionOptions.OuterXLimits = [0 10]
Example:
ax.InteractionOptions.OuterYLimits = [-10 10]
Example:
ax.InteractionOptions.OuterZLimits = [-Inf 5]
Supported Interactions
PanSupported
— Pan support indicator
"on"
(default) | on/off logical value
Pan support indicator, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A value
of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can use
the value of this property as a logical value. The value is stored as an on/off logical
value of type matlab.lang.OnOffSwitchState
.
If PanSupported
is "off"
, the pan
interaction is not included in the default interactions of the axes and the pan mode is
not supported. For example, pan(ax,"on")
is not supported.
Example:
ax.InteractionOptions.PanSupported = "off"
ZoomSupported
— Zoom support indicator
"on"
(default) | on/off logical value
Zoom support indicator, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A value
of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can use
the value of this property as a logical value. The value is stored as an on/off logical
value of type matlab.lang.OnOffSwitchState
.
If ZoomSupported
is "off"
, the zoom
interaction is not included in the default interactions of the axes and the zoom mode is
not supported. For example, zoom(ax,"on")
is not supported.
Example:
ax.InteractionOptions.ZoomSupported = "off"
RotateSupported
— Rotate support indicator
"on"
(default) | on/off logical value
Rotate support indicator, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A value
of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can use
the value of this property as a logical value. The value is stored as an on/off logical
value of type matlab.lang.OnOffSwitchState
.
If RotateSupported
is "off"
, the rotate
interaction is not included in the default interactions of the axes and the rotate mode
is not supported. For example, rotate3d(ax,"on")
is not
supported.
Example: ax.InteractionOptions.RotateSupported = "off"
DatatipsSupported
— Data tip support indicator
"on"
(default) | on/off logical value
Data tip support indicator, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A value
of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can use
the value of this property as a logical value. The value is stored as an on/off logical
value of type matlab.lang.OnOffSwitchState
.
If DatatipsSupported
is "off"
, the data tip
interaction is not included in the default interactions of the axes and the data tip
mode is not supported. For example, datacursormode(ax,"on")
is not
supported.
Example:
ax.InteractionOptions.DatatipsSupported = "off"
BrushSupported
— Brush support indicator
"on"
(default) | on/off logical value
Brush support indicator, specified as "on"
or
"off"
, or as numeric or logical 1
(true
) or 0
(false
). A value
of "on"
is equivalent to true
, and
"off"
is equivalent to false
. Thus, you can use
the value of this property as a logical value. The value is stored as an on/off logical
value of type matlab.lang.OnOffSwitchState
.
If BrushSupported
is "off"
, the brush
interaction is not included in the default interactions of the axes and the brush mode
is not supported. For example, brushmode(ax,"on")
is not
supported.
Example:
ax.InteractionOptions.BrushSupported = "off"
Interaction Display
DatatipsPlacementMethod
— Method for placing data tips
"vertex"
(default) | "interpolate"
Method for placing data tips, specified as one of these values:
"vertex"
— Hover to preview or click to create a data tip at the closest data point to the cursor location. The closest data point depends on the type of plot. For example, on a plotted curve, the closest data point is the data point with the smallest Euclidean distance from the specified location."interpolate"
— Hover to preview or click to create a data tip at the closest interpolated location on the plot to the cursor location, even if it is between data points.
Example:
ax.InteractionOptions.DatatipsPlacementMethod =
"interpolate"
RotateIndicator
— Indicator for azimuth and elevation angles during rotation
"none"
(default) | "azimuthelevation"
Indicator for azimuth and elevation angles during rotation, specified as
"none"
or "azimuthelevation"
. If
RotateIndicator
is "azimuthelevation"
, then the
axes display the azimuth and elevation angles that define the camera line of sight while
you interactively rotate the axes.
The azimuth is the angle of rotation around the z-axis, as measured from the negative y-axis. The elevation is the minimum angle between the line of sight and the xy-plane.
Example:
ax.InteractionOptions.RotateIndicator =
"azimuthelevation"
Restore View
RestoredXLimits
, RestoredYLimits
, RestoredZLimits
— Minimum and maximum limits for restored view
[0 0]
(default) | two-element vector of form [min max]
Minimum and maximum limits for the restored view of the axes, specified as a
two-element vector of the form [min max]
, where
max
is greater than min
. The axes limits are set
to [min max]
when you restore the axes view using
zoom(fig,"out")
or the Restore View button in the axes toolbar.
You can specify the limits as numeric, categorical, datetime, or duration values. However, the type of values that you specify must match the type of values along the corresponding axis.
You can specify both limits, or specify one limit and let MATLAB automatically calculate the other. For an automatically calculated minimum
or maximum limit, use -Inf
or Inf
, respectively.
MATLAB uses the "tight"
limit method to calculate the
corresponding limit.
Example:
ax.InteractionOptions.RestoredXLimits = [0 5]
Example:
ax.InteractionOptions.RestoredYLimits = [0 10]
Example:
ax.InteractionOptions.RestoredZLimits = [-10 Inf]
RestoredView
— Azimuth and elevation angles for restored view
[0 0]
(default) | two-element vector of the form [az el]
Azimuth and elevation angles for the restored view of the axes, specified as a
two-element vector of the form [az el]
, where az
and el
are the azimuth and elevation with respect to the axis origin.
For more information about setting the camera line of sight, see Setting the Viewpoint with Azimuth and Elevation.
Example:
ax.InteractionOptions.RestoredView = [45 25]
Version History
Introduced in R2023aR2024a: Renamed from InteractionOptions
The InteractionOptions
object is now called
CartesianAxesInteractionOptions
. The behavior remains the same. The name
of the InteractionOptions
property of UIAxes
objects
has not changed. Starting in R2024a, set the InteractionOptions
property of UIAxes
objects using a
CartesianAxesInteractionOptions
object.
R2023b: Indicate azimuth and elevation angles using RotateIndicator
Indicate the azimuth and elevation angles that define the camera line of sight while you
interactively rotate the axes by setting the RotateIndicator
property
to "azimuthelevation"
.
R2023b: Interpolate data tip location using DatatipsPlacementMethod
Hover to preview or click to create data tips at the closest interpolated location on
the plot to the cursor location by setting the DatatipsPlacementMethod
property to "interpolate"
.
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)