How to fit the axes with the native resolution of the image?

3 views (last 30 days)
John Doe
John Doe on 18 May 2020
Commented: John Doe on 18 May 2020
Hello everyone. I have a GUI where I am loading an image into the axes. I want the axes to wrap around the loaded image's native resolution, much like a MATLAB figure window would do.
How can I do that? Thanks in advance.

Accepted Answer

Image Analyst
Image Analyst on 18 May 2020
Adjust display size of image
truesize(fig,[mrows ncols]) adjusts the display size of an image in a figure, fig, to the dimensions [mrows ncols], in pixels.
Also, see attached demo on zooming.
  1 Comment
John Doe
John Doe on 18 May 2020
Thanks for the truesize command. Didn't know about that.
But I wanted to mean the axes ONLY to wrap around the figure, not the whole figure window. truesize is setting my whole GUI figure window to the figure size.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!