MATLAB: The image is upside down when I display it in a graph

graphimageplot

Hello,
I have a problem when I display an image in a plot.The image is upside down in the figure window.
Do you know how to fix this problem?
here is my code to display the image in the graph:
% Load the image
img = imread('KAM-Map_12s.bmp');
hold on;
% Plot the image, with x and y coordinnates
image([150 350],[4 4.7],img);
Thanks in advance

Best Answer

Simply add (only)
set(gca,'YDir','reverse');
In other words, try
img = imread('KAM-Map_12s.bmp');
hold on;
image([150 350],[4 4.7],img);
set(gca,'YDir','reverse');