필터 지우기
필터 지우기

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

조회 수: 22 (최근 30일)
Jaime Muela Pérez
Jaime Muela Pérez 2013년 3월 12일
답변: Nir Kaplan 2021년 1월 14일
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.

답변 (2개)

Walter Roberson
Walter Roberson 2013년 3월 12일
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 2021년 1월 14일
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.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by