How to change the order of the Y axis and not flip the image?

5 views (last 30 days)
I need to flip just the y axis and not the image itself. I'm using the image function to plot this image, however due to the way matlab reads images, it results in the Y axis being from top to bottom. I tried using (set(gca,'YDir','normal')) but this flips the image too. Is there a way to just flip the Yaxis? Any help would be appreciated.

Accepted Answer

jonas
jonas on 17 Jul 2018
Edited: jonas on 17 Jul 2018
You could try this:
I=imread('cameraman.tif');
figure;
subplot(1,2,1)
imshow(I);axis on
subplot(1,2,2)
I2=flipud(I)
imshow(I2);axis on
set(gca,'YDir','normal')

More Answers (0)

Community Treasure Hunt

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

Start Hunting!