enableLegacyExplorationModes - Control behavior of modes in UI figures - MATLAB (original) (raw)
Main Content
Control behavior of modes in UI figures
Since R2020a
Syntax
Description
enableLegacyExplorationModes([fig](#mw%5Fb47ec125-9dc6-44d7-abbf-3d391f4373dd))
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.
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 only affects 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.
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 the behavior of modes in traditional figures, you can use enableLegacyExplorationModes
to change the behavior of modes in UI figures. For more information about built-in interactions, see Control Chart Interactivity.
Examples
Control Behavior of Modes
Create a figure using the uifigure
function. Display two charts in a tiled chart layout.
uif = uifigure; t = tiledlayout(uif,2,1);
ax1 = nexttile(t); x = rand(20,1); y = rand(20,1); scatter(ax1,x,y)
ax2 = nexttile(t); u = [75 91 105 123.5 131 150 179 203 226 249 281.5]; bar(ax2,u)
Enable brushing for one set of axes by selecting the brush icon from the axes toolbar. Note that brushing is enabled for only the specified axes.
Call enableLegacyExplorationModes
and then select the brush icon . Note that brushing is enabled for all axes in the figure.
enableLegacyExplorationModes(uif)
Input Arguments
fig
— Target figure
Figure
object created using uifigure
Target figure, specified as a Figure
object created using theuifigure function.
Limitations
The enableLegacyInteractionModes
function may cause interactions to respond more slowly.
Algorithms
The enableLegacyExplorationModes
function sets theUseLegacyExplorationModes
property of pan
,rotate3d
, zoom
, and brush
mode objects to'on'
.
Version History
Introduced in R2020a