How to change imshow aspect ratio in Matplotlib?
Aspect ratio is the ratio of height to width of the image we want to display. Matplotlib provides us the feature of modifying the aspect ratio of our image by specifying the value for the optional aspect ratio attribute for our image plot.
Syntax: pyplot.imshow(image, aspect=’value’)
We can replace the value for the aspect ratio with ‘equal’, ‘auto’, or any float value representing the desired aspect ratio. For this article, we have used the below image to demonstrate the changes in aspect ratio using Matplotlib.
My Personal Notes arrow_drop_up
Please Login to comment...