Main Content

enableLegacyExplorationModes

Control behavior of modes in UI figures

Description

example

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.

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

collapse all

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 from the axes toolbar. Note that brushing is enabled for only the specified axes.

Call enableLegacyExplorationModes and then select . Note that brushing is enabled for all axes in the figure.

enableLegacyExplorationModes(uif)

Input Arguments

collapse all

Target figure, specified as a Figure object created using the uifigure function.

Limitations

The enableLegacyInteractionModes function may cause interactions to respond more slowly.

Algorithms

The enableLegacyExplorationModes function sets the UseLegacyExplorationModes property of pan, rotate3d, zoom, and brush mode objects to 'on'.

Introduced in R2020a