MATLAB Answers

reverse Y axis with Imagesc()

13 views (last 30 days)
Turbulence Analysis
Turbulence Analysis on 2 Oct 2020
Commented: Ameer Hamza on 2 Oct 2020
Hi,
How to reverse the Y axis while displaying images with imagesc () function.. I have tried as follows, it does the job, however, reverses the image as well.
ax = gca;
imagesc(x,y,I');
set(gca, 'YDir','normal');

  0 Comments

Sign in to comment.

Answers (1)

Ameer Hamza
Ameer Hamza on 2 Oct 2020
Set to reverse
set(gca, 'YDir','reverse');

  3 Comments

Turbulence Analysis
Turbulence Analysis on 2 Oct 2020
Thanks.. I tried, with 'reverse' function no change at all.
Turbulence Analysis
Turbulence Analysis on 2 Oct 2020
Hi, I sorted it out. just added.
I1 = (fliplr(I));
Ameer Hamza
Ameer Hamza on 2 Oct 2020
Ah!! Y-axis is already reversed in imagesc. I think you wanted to flip x-axis?

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!