New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large top/bottom padding for imshow images #553
Comments
Centring the image is standard Matplotlib behaviour. If you want the image at the top of its axes you can set the anchor to 'N' for north: plt.gca().set_anchor('N') |
Thanks, centering helps a bit in the sense that the viable information is aligned on top. But the the canvas is still far too large for actual figure. Now the free space is just all in the south :) |
There may be some confusion about terms here:
If you want to keep the figure this size but stretch the image so it fits better, try |
Right, I made a mistake when setting the figsize in my mimimum reproducing example. Actually I compute the figsize using data shape and the current DPI. This leads to the desired output. Thanks for your support. |
Describe the issue
When plotting an image using pylab.imshow(), the top and bottom padding are very large.
I'm using the Agg backend with ipympls frontend. I expected the image to be shown at the top. It seems centered in the output div.
The code to generate the plot is this snippet:
Versions
The text was updated successfully, but these errors were encountered: