After adding
bbox_inches="tight"
to an invocation of plt.savefig
that has worked for several years, I get
/usr/local/lib/python2.7/site-packages/matplotlib/figure.py:1744: UserWarning:
This figure includes Axes that are not compatible with tight_layout, so its results might be incorrect
The figure in question appears to work (without truncation of annotations now), but I wonder what this error could mean and whether there's anything obvious or known (without digging deep into complex figure code) that I can do to address it.
Is there some known or common cause for this that I should look for in my code?
In my experience, plt.tight_layout
doesn't always work but plt.savefig('fig.png',bbox_inches='tight')
does. In addition, you don't need the former after using the latter and I have come to the conclusion after some pretty extensive testing of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With