Main Content

enableDefaultInteractivity

Enable built-in axes interactions

Description

enableDefaultInteractivity(ax) enables the built-in interactions for the specified axes, if they are not already enabled. You can use this function to enable the default set of interactions or a custom set of interactions.

example

Examples

collapse all

Create a plot. Some interactions are enabled by default, such as scrolling to zoom. Disable these default interactions.

plot(magic(10))
ax = gca;
disableDefaultInteractivity(ax)

Then, reenable the interactions.

enableDefaultInteractivity(ax)

Create a plot, and replace the default set of axes interactions with just the rotate and zoom interactions. Then disable the interactions.

plot(magic(10))
ax = gca;
ax.Interactions = [rotateInteraction zoomInteraction];
disableDefaultInteractivity(ax)

Reenable the interactions you created.

enableDefaultInteractivity(ax)

Input Arguments

collapse all

Axes, specified as an Axes, PolarAxes, or GeographicAxes object.

More About

collapse all

Version History

Introduced in R2018b