Skip to content

The output figure file is strange: there is a lot of blank area on the output figure. #12376

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

Closed
geatpy-dev opened this issue Oct 3, 2018 · 5 comments

Comments

@geatpy-dev
Copy link

geatpy-dev commented Oct 3, 2018

Bug report

Bug summary

Code for reproduction

# 
plt.savefig('Photo.png', dpi=600, bbox_inches='tight')
#

Actual outcome

image

# If applicable, paste the console output here
# The output figure can be seen as below:

#

Expected outcome

Matplotlib version

  • Operating system: windows10 x64
  • Matplotlib version: 3.0.0
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version: 3.5、3.6
  • Jupyter version (if applicable):
  • Other libraries:

The output figure file is strange: there is a lot of blank area on the output figure.

@geatpy-dev
Copy link
Author

The output figure is normal if I used matplotlib v2.2.3, but having problem in v3.0.0, please help me, thanks!

@QuLogic
Copy link
Member

QuLogic commented Oct 3, 2018

You will need to provide more code than just a single final line for us to be able to say anything.

@geatpy-dev
Copy link
Author

geatpy-dev commented Oct 3, 2018

You will need to provide more code than just a single final line for us to be able to say anything.

Thank you very much. I found a solution just now: just change the code from "plt.savefig('Photo.png', dpi=600, bbox_inches='tight')" to "plt.savefig('Photo.png', dpi=600)", and now the output figure is normal.
image

But I have no idea why aftering deleting the code "bbox_inches='tight'" and the output figure is normal.
The whloe codes are show as below:
image

Please help me, Thank you!

@dstansby
Copy link
Member

dstansby commented Oct 3, 2018

Is there any chance you could provide a complete, minimal, self contained example that we can run to try and reproduce the issue? Otherwise it is hard to see what is going on to cause the issue.

@jklymak
Copy link
Member

jklymak commented Oct 3, 2018

This is almost certainly a duplicate of #12239 and closed by #12241.

Please feel free to recommend if this is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants