MATLAB Answers

How can I do to enable zoom only for a specific axes?

10 views (last 30 days)
Giuela on 3 Mar 2021
Commented: Giuela on 4 Mar 2021
In my figure I have two axis showing two plots, and another axes, filled by an image,that I use such a 'button'.
The 'button' do something when the mouse pointer is over it and I click.
My problem is that when I set the zoom option for the first (or the second) axes, it works also for the 'button', that is, when i click on the button image, the image zooms.
I've also noticed that when I choose the zoom-in option in the axes toolbar of the first axes, also for the second axes the zoom-in option is selected.
I want to apply the zoom, pan, or rotate options ONLY for the axes I choose; in the attached code I've tried to use the disableDefaultInteractivity function, but without success. Could anyone suggest me how to do?

Accepted Answer

Steven Lord
Steven Lord on 3 Mar 2021
Call zoom with an output. Call setAllowAxesZoom on that object. See the "Object Functions" section on the documentation page for zoom for more information.
Giuela on 4 Mar 2021
I thought that was enough to enabe the axes toolbar for the axes I don't want to zoom or pan it, but it's not true, so I guess the axis toolbars don't operate only for the axes' owner, but they work for ALL the figure's axes.

Sign in to comment.

More Answers (0)





Community Treasure Hunt

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

Start Hunting!