https://www.mathworks.com/matlabcentral/answers/408041-how-to-reverse-y-axis-on-image
How to reverse Y axis on image?
By default, y axis of an image is upside-down, values ascending from top down. If you set(gca,'YDir','normal'), you will reverse y axis. (gca,'YDir','reverse') will only leave y axis unchanged from default.