How do I reverse the y-axis in image?
Show older comments
The image function reverses the y-axis so I wanted to reverse it to correct it. I know it has something to do with gca but cannot figure out the right code. Please help me.
Accepted Answer
More Answers (4)
Chad Greene
on 25 Nov 2014
And another solution:
axis ij
2 Comments
Iana Ladygina
on 4 Mar 2020
thank you!
Wybekrik
on 24 Apr 2020
Just what i was looking for!
Wagih Abu Rowin
on 5 Oct 2018
12 votes
set(gca,'Ydir','reverse')
1 Comment
Shushobhit Chaudhary
on 28 May 2019
This is the best answer. Thanks a lot. It helped me a lot.
Shane
on 25 Nov 2014
2 votes
Alternatively, you can flip the array. Either fliplr or flipud Flip Left-Right, or Up-Down, depending on how your data is.
plot(X, fliplr(Y))
Jamel
on 7 Jun 2022
0 votes
How do I reverse the "Interference from Satellite Constellation Communication Link" code, where the direction starts from the opposite way.
Categories
Find more on Image Arithmetic 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!