imshow - Stretching image to fill axis

I'm trying to display an image on an axis within a GUI. I'm using the imshow function, but it keeps the dimension ratio of the image. I would like to stretch the image, ignoring the dimension ratio, to fill the axis. Any suggestions?
Thanks, Matt

 采纳的回答

You can display with imshow() and use the 'XData' and 'YData' property. For example:
imshow(grayImage, [], 'XData', [0 .5], 'YData', [0 .1]);

2 个评论

You can pass in coordinates to image() and imagesc()
Xdata and Ydata worked great, thanks!

请先登录,再进行评论。

更多回答(1 个)

Jurgen
Jurgen 2013-1-13
Have you tried image or imagesc? Or the 'axis image' command?

类别

帮助中心File Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by