imshow - Stretching image to fill axis

22 views (last 30 days)
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

Accepted Answer

Image Analyst
Image Analyst on 13 Jan 2013
Edited: Image Analyst on 14 Jan 2013
You can display with imshow() and use the 'XData' and 'YData' property. For example:
imshow(grayImage, [], 'XData', [0 .5], 'YData', [0 .1]);
  2 Comments
Walter Roberson
Walter Roberson on 14 Jan 2013
You can pass in coordinates to image() and imagesc()
Matt
Matt on 14 Jan 2013
Xdata and Ydata worked great, thanks!

Sign in to comment.

More Answers (1)

Jurgen
Jurgen on 13 Jan 2013
Have you tried image or imagesc? Or the 'axis image' command?

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!