show an image in the center of the axes
조회 수: 5 (최근 30일)
이전 댓글 표시
Hello,
I have a fixed axes in a GUI (position: [517 125 283 459]). I'm showing an image in this axes:
axes(handles.imagenanatomica) imshow(imagen,[]) or imshow(imagen,'parent',handles.imagenanatomica).
The 'imshow' function shows the image smaller than the axes'size so as to not deform the image. Here I have two questions:
1) The image is not in the center of the axes, it appears at the top-left of the axes.¿Is it possible to center the image in the axes?
2) Is it posiible to show the image bigger?. I mean, not as the size of the axes but a bit bigger than it appears.
Thank you very much.
Silvia
댓글 수: 0
답변 (1개)
Image Analyst
2013년 7월 5일
1) imshow() automatically tries to fit the image into the existing space allocated from the axes. It will scale it down, maintaining the aspect ratio if it has to, in order to get it to fit.
2) You can use the InitialMagnification option of imshow to override the fitting functionality. For example 'InitialMagnification', 800 will make each pixel 8 pixels. I believe this will give scroll bars or a hand cursor so you can pan/scroll the image.
댓글 수: 2
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!