Skip to content

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

Closed

Description

@geatpy-dev

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.

Activity

  1. geatpy-dev commented on Oct 3, 2018

    @geatpy-dev
    Author

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

  2. QuLogic commented on Oct 3, 2018

    @QuLogic
    Member

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

  3. geatpy-dev commented on Oct 3, 2018

    @geatpy-dev
    Author

    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!

  4. dstansby commented on Oct 3, 2018

    @dstansby
    Member

    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.

  5. jklymak commented on Oct 3, 2018

    @jklymak
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions