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!