Reversing the y-axis values without reversing the image.

1 Ansicht (letzte 30 Tage)
Syed Mashruk
Syed Mashruk am 22 Nov. 2020
Bearbeitet: Syed Mashruk am 22 Nov. 2020
Hi,
I would like to flip the y-axis values without flipping the image. Your help is much appreciated.

Antworten (3)

Ameer Hamza
Ameer Hamza am 22 Nov. 2020
An easy solution will be just flip the labels. Run the following line
yticklabels(flip(yticklabels))
after creating the figure.
  1 Kommentar
Ameer Hamza
Ameer Hamza am 22 Nov. 2020
Can you explain what do you mean by "Though it flips the Y-axis values but does not start from X-axis"? Can you draw on this image to show the expected output?

Melden Sie sich an, um zu kommentieren.


Image Analyst
Image Analyst am 22 Nov. 2020
After you display the image, try
axis xy
  1 Kommentar
Image Analyst
Image Analyst am 22 Nov. 2020
Did you try using YData in imshow():
yourImage = imread('peppers.png');
[rows, columns, numColorChannels] = size(yourImage);
imshow(yourImage, 'YData', [rows, 1]);
axis xy

Melden Sie sich an, um zu kommentieren.


Syed Mashruk
Syed Mashruk am 22 Nov. 2020
Thanks both. I have solved the problem using 'fliplr' command.

Community Treasure Hunt

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

Start Hunting!

Translated by