Maintain image aspect ratio on figure resize
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello!
I am working with a fairly complex GUI which has a logo in the upper left hand corner. Currently when the figure is resized, the image resize in direct proportion to the figure. As a result you can make really mess up aspect ratio. I tried disable stretch-to-fill, but it didn't seem to work.
Any ideas?
Thanks in advance!
댓글 수: 0
채택된 답변
Patrick Kalita
2011년 5월 31일
I'm assuming that the logo is displayed as an image inside an axes. If that's correct and you have the handle to the axes, you can include the following statement in the code that sets up the GUI:
axis(h, 'image')
where h is the handle to the axes.
댓글 수: 0
추가 답변 (1개)
Walter Roberson
2011년 5월 31일
Do not use normalized units to position the image -- or if you must use normalized units for the original positioning, change to absolute units afterwards.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!