Is it possible to enable zoom in only one of the axes? (using GUIDE)

16 views (last 30 days)
Hi,
I'm making a GUI with the Matlab's GUIDE tool. I have two different axes; in one of them i'm plotting some 2-D data, while in the other one im plotting some 3-D data. I want to enable the zoom in only the first one, but no matter what i do it just enables itself on both of the axes. Is there any way i can do that? I'm trying to do
zoom(handles.plot_time, 'on');
where plot_time is the name of the axes i want to zoom in, but like i said it also enables zoom in the other one. Maybe there's something wrong with my code somewhere else, but i've looked everywhere.
Thanks in advance.

Answers (2)

Walter Roberson
Walter Roberson on 12 Mar 2013
No, zoom() applies to the entire figure.
However, you can use zoom's ButtonDownFilter callback to check which axes you are over and return false if you do not want that axes zoomed.

Nir Kaplan
Nir Kaplan on 14 Jan 2021
The "setAllowAxesZoom" function can be used to enable\disable the Zoom function for specific axes.
By defult all the axes in the figure are enable for zomming, so i assume you wand to disable specific axes, for that i added to the "OpeningFcn" of the GUI the folowing line:
% Disable zoom in images axes
setAllowAxesZoom(zoom(), handles_to_image_axes, false);
I use R2013B.

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!