enableLegacyExplorationModes
Control behavior of modes in figures
Description
enableLegacyExplorationModes(
changes the
behavior of interaction modes in figures. The behavior changes from the default behavior, in
which you can control interaction behavior on a per axis basis, to
legacy exploration modes. For more information, see Legacy Exploration Modes. (since R2025a)fig
)
In most cases, you do not need to use this function. By default, most types of charts
include a set of built-in interactions that are faster than interaction modes and do not
require you to enable a mode. However, if you have code that relies on legacy exploration
modes, then you can use enableLegacyExplorationModes
to change the
behavior. For more information about built-in interactions, see Control Chart Interactivity.
Note
Once you change the behavior of a figure to legacy exploration modes, you cannot change the behavior back to the default behavior.
Before R2025a: enableLegacyExplorationModes(fig)
changes the behavior of interaction
modes in UI figures created using the uifigure
function or in
MATLAB®
Online™. The behavior changes to match the behavior of modes in traditional figures
created using the figure
function.
Before R2025a: Interaction modes such as pan, zoom, rotate, and brush behave differently for traditional figures and UI figures. For example, enabling zoom in a UI figure affects only the specified axes, while enabling zoom in a traditional figure affects all of the axes in the figure. Additionally, context menus are not supported for modes in UI figures, but are supported for modes in traditional figures.
Examples
Input Arguments
Limitations
The
enableLegacyExplorationModes
function might cause interactions to respond more slowly.If you enable legacy exploration modes on a figure, then you can no longer control the interactions on individual axes in the figure using the
InteractionOptions
property of the axes. If you specify values for theInteractionOptions
property of an axes object inside a figure that has legacy exploration modes enabled, then MATLAB issues a warning that no action has been taken.
More About
Algorithms
The
enableLegacyExplorationModes
function sets theUseLegacyExplorationModes
property ofpan
,zoom
,rotate3d
, andbrush
mode objects to"on"
.If you create an interaction mode object for a figure and then either specify a value for a property of that object or call one of the object functions of that object, then MATLAB enables legacy exploration modes on the figure. For example, this code enables legacy exploration modes on the figure because it specifies a value for the
Motion
property of thepan
mode object.f = figure; ax = axes(f); plot(ax,1:10,1:10); p = pan(f); p.Motion = "vertical"
Note
An exception to this rule is the
UpdateFcn
property of thedatacursormode
object. Setting this property does not enable legacy exploration modes.
Version History
Introduced in R2020a