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
{{ message }}
Repository navigation
[Bug]: calling fig.tight_layout multiple times #26290
If you are just using Matplotlib, don't call tight layout multiple times, or better use plt.figure(..., layout='constrained'). However, if you are using a downstream library that calls tight layout for you then you are somewhat stuck
There is a major problem with tight_layout. If you call it on a figure, then close that figure and open a new figure, frequently the following figures get messed up. Setting tight_layout to False does not fix this.
Activity
tacaswell commentedon Jul 12, 2023
likely related to posit-dev/py-shiny#611
FIX: do not warn when calling tight_layout multiple times
FIX: do not warn when calling tight_layout multiple times
lcrmorin commentedon Aug 20, 2023
Any way to avoid the message in the code - without having to disable warnings - ? (defining the layout explicitly ?)
jklymak commentedon Aug 20, 2023
If you are just using Matplotlib, don't call tight layout multiple times, or better use
plt.figure(..., layout='constrained'). However, if you are using a downstream library that calls tight layout for you then you are somewhat stuckRefactor: resolve user warnings
crchinn commentedon Oct 20, 2023
There is a major problem with tight_layout. If you call it on a figure, then close that figure and open a new figure, frequently the following figures get messed up. Setting tight_layout to False does not fix this.
jklymak commentedon Oct 21, 2023
@crchinn please open a new issue if you have problems with tight_layout wth reproducible self contained examples.