Delete axes interactions not working?

3 vues (au cours des 30 derniers jours)
Sven
Sven le 23 Avr 2021
Modifié(e) : Adam Danz le 23 Avr 2021
I'm using 2021a and it seems that deleting/disabling interactions isn't working as expected. I'm just trying to either (1) make an axes with just the pan interaction, or (2) make an axes with all interactions removed
fH = figure
ax = gca;
ax.Interactions = panInteraction % I only want the pan interaction but this line seems to do nothing
Similarly removing all via the following is ineffective:
ax.Interactions = [] % This line also seems to do nothing
I'm trying to make a safe figure that the user can't break so I really want to limit what they can do. The only thing I seem to be able to do is make the toolbar invisible via:
ax.Toolbar.Visible = false
Is this a bug? I seem to remember having the ability to manipulate ax.Interactions in earlier MATLAB versions ...
Thanks,
Sven

Réponse acceptée

Adam Danz
Adam Danz le 23 Avr 2021
Modifié(e) : Adam Danz le 23 Avr 2021
Difference between toolbar and interactions
Interactions are the actions available by using the mouse to zoom/pan/rotate etc the axes without activing a tool in the axis toolbar. For example, after generating a figure that supports zooming you can use the mouse scroll wheel to immediately zoom into the axes.
The toolbar property is independed of the interactions property. For example, you can remove panning from the toolbar but still allow for interactive panning by mouse actions.
I agree that these differences could be clearer in the documentation.
Specify toolbar tools
To specify toolbar tools, use the axtoolbar function. This example reduces the toolbar to the pan tool.
ax = gca();
tb = axtoolbar(ax,'pan')
See the toolbar link I provided above for all toolbar options.
Specify axis interactions
To disable all tools except panning, set the Interactions property of the axes. This example reduces interactions to panning.
ax = gca;
ax.Interactions = panInteraction;
See the interactions link I provided above for all interaction options.
  4 commentaires
Sven
Sven le 23 Avr 2021
Yep, that's the lag I'm talking about (line being hovered over gets highlighted and cursor changes to fleur) and the general performance if you, say, grab a line and wiggle the mouse around. Hah, ~1sec is probably an overestimation so I should have avoided the term "literally" :)
I'd say it's 250ms on my machine, particularly for the cursor change. But the lag when simply dragging those totally vanilla lines around is very, very noticable - enough so that I don't even want to consider what it would be like when conditions are non-ideal (like adding "MovingROI" listeners with non-trivial calculation time in their callbacks, or like when running on remote machines which is becoming more common these days, or when precise cursor movements are desirable).
Adam Danz
Adam Danz le 23 Avr 2021
Modifié(e) : Adam Danz le 23 Avr 2021
I see what you mean now, thanks for the usecase description. I wish I could suggest something but I have a feeling the cause of the difference in processing speed is quit deeply rooted.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Interaction Control dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by