Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bbox_inches="tight" causes huge figures and text far outside figure frame #883

Closed
@jordens

Description

@jordens

I am unhappy with PR #689 and PR #739. Now with bbox_inches="tight"

import matplotlib.pyplot as plt
plt.text(5, 5, "foo")
plt.savefig("bug1740_text.png", format="png", bbox_inches="tight")

produces a huge mostly empty figure with the frame in the lower left.
It crashes if the text is placed further away from the frame because the figure is becoming too large (ipython issue #1740). I believe the right solution to matplotlib issue #689 would be to only adapt the bbox to the text artists that are decorations of the figure (axes, axes labels, titles) but ignore the text pieces in data coordinate space that fall outside axes frame.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions