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
importmatplotlib.pyplotasplt# Use-case: at the beginning of a sessionfig, ax=plt.subplots(constrained_layout=True, num='boo')
fig.suptitle("Dummy")
plt.show()
# Use-case: later in the same sessionfig, ax=plt.subplots(constrained_layout=True, num='boo', clear=True)
ax.plot(range(30))
plt.show()
#=> boom, AttributeError
Some test snippet to put in test_constrainedlayout.py
deftest_constrained_layout23():
''' Comment in #11035: suptitle used to cause an exception when reusing a figure w/ CL with ``clear=True``. '''foriinrange(2):
fig, ax=plt.subplots(num="123", constrained_layout=True, clear=True)
fig.suptitle(f"Suptitle {i}".format(i))
The text was updated successfully, but these errors were encountered:
Bug report
Bug summary
Suptitle and constrained layout raises an exception whenclearing-and-reusing an existing figure. Originally noticed in #11035 .
Attn @jklymak aka. our layout manager expert
Code for reproduction
Actual outcome
Expected outcome
No Exception, but a clear Figure named 'boo'.
Matplotlib version
print(matplotlib.get_backend())
): Qt5AggBeing there
Some test snippet to put in
test_constrainedlayout.py
The text was updated successfully, but these errors were encountered: