Matplotlib Error: “figure includes Axes that are not compatible with tight_layout”

前端 未结 1 1327
伪装坚强ぢ
伪装坚强ぢ 2020-12-29 22:28

After adding

bbox_inches="tight"

to an invocation of plt.savefig that has worked for several years, I get

相关标签:
1条回答
  • 2020-12-29 22:54

    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.

    0 讨论(0)
提交回复
热议问题