필터 지우기
필터 지우기

Can I lock the Y axis (Even when the Zoom In/Out is used)?

조회 수: 64 (최근 30일)
Nimrodb
Nimrodb 2013년 3월 4일
댓글: raym 2022년 12월 10일
I have a plot and I want the user to not be able to change the Y axis. Is it possible?
Is there a call back option to the Zoom In/Out tool function?

채택된 답변

Nimrodb
Nimrodb 2013년 3월 8일
This is the solution:
ZoomHandle = zoom(h.Figure(1))
set(ZoomHandle,'Motion','horizontal')
Thanks to all that helped!
  댓글 수: 2
raym
raym 2022년 12월 10일
I tried both
zoom yon
and
ZoomHandle = zoom(h.Figure(1))
set(ZoomHandle,'Motion','horizontal')
it worked on live fig, but when fig is stored as .fig and re-opened, it still zooms in both direction when clicking zoom+ button.
Did you solve this problem?
raym
raym 2022년 12월 10일
Got a solution here:
https://www.mathworks.com/matlabcentral/answers/405528-how-can-i-ensure-that-zoom-is-on-by-default-when-i-open-a-figure

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jan
Jan 2013년 3월 4일
Yes, there is a zoom button in the figure's toolbar.
The zoom command is an option also, e.g.:
zoom yon
another idea is to set the axes 's 'YLim' property directly.
  댓글 수: 2
Nimrodb
Nimrodb 2013년 3월 4일
But when I press the Zoom button and mark my zoom area on the figure - the X and the Y axes change.
I want to be able to keep the Y axis const.
Nimrodb
Nimrodb 2013년 3월 8일
I noticed that under the tab of 'Tools' there is an 'Options' item.
There I can select that the Zoom will be a 'Horizontal Zoom'.
Is it possible to have that by default when the Plot is opened?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Visual Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by