Issue
When I call fig.set_tight_layout(True)
on a Matplotlib figure, I receive this deprecation warning:
The set_tight_layout function will be deprecated in a future version. Use set_layout_engine instead.
How do I call set_layout_engine
so as to match the current behavior as closely as possible?
Environment:
OS: Mac
Python: 3.10.6
matplotlib: 3.7.2
Solution
From: https://matplotlib.org/stable/api/figure_api.html#matplotlib.figure.Figure.set_layout_engine
fig.set_layout_engine("tight")
Answered By - Cem Koçak
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.