Reversing the y-axis values without reversing the image.

1 visualización (últimos 30 días)
Syed Mashruk
Syed Mashruk el 22 de Nov. de 2020
Editada: Syed Mashruk el 22 de Nov. de 2020
Hi,
I would like to flip the y-axis values without flipping the image. Your help is much appreciated.

Respuestas (3)

Ameer Hamza
Ameer Hamza el 22 de Nov. de 2020
An easy solution will be just flip the labels. Run the following line
yticklabels(flip(yticklabels))
after creating the figure.
  1 comentario
Ameer Hamza
Ameer Hamza el 22 de Nov. de 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?

Iniciar sesión para comentar.


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

Iniciar sesión para comentar.


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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by