Zooming in axes in GUI causes axes to expand.

I have a axes where I am plotting my XYZ data using plot3(X,Y,Z,,'b.').
So far so good, but when I want zoom in on the axes, the extent of that axes increases and it goes beyond the predefined size in the GUI such that it starts covering the whole GUI.
How to prevent this from happening so that when I zoom the size of the axes does not change?

댓글 수: 3

Doug Hull
Doug Hull 2011년 7월 22일
Can you post screenshots or SIMPLE code that can reproduce?
Sukuchha
Sukuchha 2011년 7월 23일
I will do that after i go to office after weekend! thanks !
Sukuchha
Sukuchha 2011년 7월 24일
Doug,
Here is before and after screen shots!
Notice the enlarsement of the axes size on the right side after i zoom.
Before: http://goo.gl/2Osbg
After : http://goo.gl/g1wQO

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

답변 (5개)

Jan
Jan 2011년 7월 23일

1 개 추천

댓글 수: 1

Sukuchha
Sukuchha 2011년 7월 24일
Jan, yes my problem is similar ! Any thoughts how it can be solved ?

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

Ahmed AKL
Ahmed AKL 2017년 8월 31일
편집: Ahmed AKL 2017년 8월 31일

1 개 추천

I'm using GUIDE to create a UI interface that has a map. When I try to Zoom I've the same issue. This solution worked with me:
  1. make a panel
  2. choose panel border to be 'none'
  3. insert the axes (i.e. your map) inside the panel
  4. The problem is still there, but it is bounded by the panel, so it is not visible
Walter Roberson
Walter Roberson 2011년 7월 23일

0 개 추천

Is this plot inside a uipanel? If so then you need to set the uipanel Clipping property.

댓글 수: 1

Sukuchha
Sukuchha 2011년 7월 23일
its not within a uipanel ! its just a plain axes in a gui !

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

Bilen Oytun Peksel
Bilen Oytun Peksel 2012년 11월 12일

0 개 추천

The problem here is:
If the view angles (az,el check out 'help view') are set to different values than usual xy xz or yz views the zoom behaviour changes. For 2D axis zoom manipulates axis limits thus axis size is retained. If however the view angles change into some other value with for instance rotate3d function zoom function begins to manipulate 'cameraposition' or 'cameraviewangle' which makes the axis grow on the screen. In theory it can be avoided by adjusting the axis limits accordingly but when you do it it behaves strangely and not as intended.
I am having the same problem myself and assigning the axes as a children of other objects like uipanel doesnt help. Only solution I came up with was to make another figure docked into the main figure. The axes is assigned as the child of that figure. However I am still struggling with the docking stuff.
fenix.d.0831
fenix.d.0831 2017년 11월 3일

0 개 추천

my solution is to set the axes as parent of the plot
for example:
h=plot(x, y); set(h, 'parent', axes)

카테고리

도움말 센터File Exchange에서 Data Exploration에 대해 자세히 알아보기

태그

질문:

2011년 7월 22일

댓글:

2020년 6월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by