I am trying to display an image with imshow. What I am doing now is
to write a small function which plot the image preserving the aspect
ratio of the pixels in X and Y, but scaling the size of the image of the window
but at the same time scaling the axes either to just surround the image
(default) or to be larger.
This should be easy as I can use 'preserve'
for the 'aspect' of imshow: that takes care of the pixel scale on the figure.
However then it does have axis which show incorrect coordinates, namely:
- along the direction where the image is filling the figure window better
it shows the right coordinates
- along the other direction, the image is not filling the entire length
(as expected if the image does not follow the window aspect ratio)
but the axis are STILL showing the limits of the image.
To be clear:
for a square figure window.
If my image is 100 x 50,
then with aspect='preserve' I have the right coordinates along X
(showing 0==> 100) but the wrong coordinates for Y (showing 0=>50,
and NOT 0=>100 as it should since it fills only half the figure...).
I hope this is clear.
Am I doing something wrong there?