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.

rotateInteraction

Rotate interaction

Description

A rotate interaction allows you to rotate a chart without having to select any buttons in the axes toolbar. To enable chart rotation, set the Interactions property of the axes to a rotateInteraction object. When this interaction is enabled, you can rotate a chart by dragging it.

To enable multiple interactions, set the Interactions property to an array of objects.

Creation

Syntax

r = rotateInteraction

Description

example

r = rotateInteraction creates a rotate interaction object.

Examples

collapse all

Create a surface plot. Get the current axes and replace the default interactions with the rotate and data tip interactions. Then hover over the surface to display data tips. Drag to rotate the plot.

surf(peaks)
ax = gca;
ax.Interactions = [rotateInteraction dataTipInteraction];

Limitations

The rotateInteraction function is not supported in the Live Editor.

Tips

In most cases, the axes have a default set of interactions which depend on the type of chart you are displaying. You can replace the default set with a new set of interactions, but you cannot access or modify any of the interactions in the default set.

Introduced in R2019a