Image alignment after using 'axis image'

75 views (last 30 days)
SG on 28 Jul 2015
Answered: Usha Duddu on 31 Jul 2015
I'm displaying an image and then using 'axis image' to keep the right proportions. This re-sizing process places the resulting image in the middle of the subplot, but I'd like to align the image to the left. Is there a way to achieve this?
RGB = imread('C:\Users\...\file.png');
axis image;

Answers (1)

Usha Duddu
Usha Duddu on 31 Jul 2015
I understand that you are trying to align an image over the left hand corner of a subplot. It is not possible to do it while using axis image since this command will fit the axes box tightly around the data. Below is a simplified example code snippet that performs the desired functionality.
You can use 'position' property of axes object in order to position the image at the desired location within the figure.
Hope this helps!


Find more on Images 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!