This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Disable built-in axes interactions





disableDefaultInteractivity(ax) disables the built-in interactions for the specified axes. You can use this function to disable the default axes interactions or a custom set of axes interactions. After disabling the interactions, you can still use the buttons in the axes toolbar to interact with the plot.


collapse all

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

ax = gca;

Then, reenable the interactions.


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

ax = gca;
ax.Interactions = [rotateInteraction zoomInteraction];

Then, disable the interactions you created.


Input Arguments

collapse all

Axes, specified as an Axes or PolarAxes object.

More About

collapse all

Built-In Axes Interactions

These interactions are for exploring charts using gestures, such as dragging to pan or scrolling to zoom. They are built into the parent axes and are available without having to select any of the buttons in the axes toolbar. Most types axes include a default set of built-in interactions, but you can customize them by setting the Interactions property of the axes.

If you do not want any of the interactions enabled, use the disableDefaultInteractivity function to disable them. To enable them if they are not already enabled, use the enableDefaultInteractivity function.

Introduced in R2018b