필터 지우기
필터 지우기

GUI axes size?

조회 수: 3 (최근 30일)
Kyle
Kyle 2011년 7월 10일
답변: elassa houda 2020년 10월 27일
Hi,
After loading image into an axes, the axes automatically adjust its size to fit the image(i'm happy with it changes size accordingly to image). however after i clear the image the axes size is till the size of the previous image.
How do i set it back to the axes to the original size n location as be4 i loaded any image?
cla(handles.im2)
set(handles.im2,'Visible','on');
i tried set(handles.im2,'OuterPosition',[64.16 16.19 104.57 26.35]); set(handles.im2,'Position',[92 20 57 20]);
these but nothing changes.
  댓글 수: 3
Nan
Nan 2012년 9월 8일
I want to know how do you adjust the axes size to fit the image.
elassa houda
elassa houda 2020년 10월 27일
i want how do you adjust the axes size to fitth e image

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

답변 (3개)

Image Analyst
Image Analyst 2011년 7월 10일
  댓글 수: 2
Kyle
Kyle 2011년 7월 10일
i tried this
cla(handles.im1,'reset')
and it disable the ButtonDownFcn that allows me to insert image by clicking on the axes itself
cla reset
does like the previous code, But is reset all axes in 1 line.
Image Analyst
Image Analyst 2012년 9월 8일
Try this:
set(gca, 'units','normalized', 'outerposition',[0.2 0.3 .5 .2]);
Play around with the parameters until you get what you want.

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


Tom
Tom 2012년 9월 8일
편집: Tom 2012년 9월 8일
You could store the original axes size somewhere and reinstate that when required. For example, when the GUI loads you could store the position in the axes' user data:
set(ax_handle,'UserData',get(ax_handle,'Position'))
and then apply the axes size each time you clear the image:
set(ax_handle,'Position',get(ax_handle,'UserData'))
Obviously, watch out for units.

elassa houda
elassa houda 2020년 10월 27일
i want how do you adjust the axes size to fitth the image

카테고리

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