You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
First, I just want to clarify that what should be a really buggy behavior is with text outside of axes area with clip_on=True.
plt.text(5, 5, "foo", clip_on=True)
Well, to me, it is about good-enough default behavior. And when I committed change, people (although limited) seemed to like the default behavior.
The heuristics to determine which texts to include in calculating the tight bbox need more improvements and I admit that current implementation is very naive.
On the other hand, a command like suptitle creates a regular text artist and it is not straight-forward to distinguish them from other normal text artists. On the other hand, with annotate command, it is more doable. And I will try to work on that.
For now, I recommend you to explicitly set bbox_extra_artists to prevent the default behavior.
I am unhappy with PR #689 and PR #739. Now with 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.
The text was updated successfully, but these errors were encountered: