Fit UIAxes to image dimensions automatically

I use the code (App designer file attach) to mark a ROI. On of the things that I can not solve is that the UIAxes dimension are bigger than the image (white background) as well that the customizable rectangular ROI can be set outside the image dimension.
Therefore, How can I set the UIAxes to fit any image dimensions automatically?

답변 (1개)

Dave B
Dave B 2022년 2월 2일

1 개 추천

How about adding the line:
axis(app.ImageAxes, 'tight');
in the LoadimageButtonPushed method after the imshow line?
Also note, if you really want to ensure the roi never leaves the image, you're best off using images.roi.Rectangle as discussed in this answer.

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2022년 2월 2일

답변:

2022년 2월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by