8000 DOC: warn if user is using constrained layout and tries to use subplo… · matplotlib/matplotlib@5604c21 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5604c21

Browse files
committed
DOC: warn if user is using constrained layout and tries to use subplots_adjust
1 parent 5dc51e0 commit 5604c21

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/matplotlib/figure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,6 +2092,12 @@ def subplots_adjust(self, left=None, bottom=None, right=None, top=None,
20922092
*None*) and update the subplot locations.
20932093
20942094
"""
2095+
if self.get_constrained_layout():
2096+
self.set_constrained_layout(False)
2097+
warnings.warn("This figure was using constrained_layout==True, "
2098+
"but that is incompatible with subplots_adjust and "
2099+
"or tight_layout: setting "
2100+
"constrained_layout==False. ")
20952101
self.subplotpars.update(left, bottom, right, top, wspace, hspace)
20962102
for ax in self.axes:
20972103
if not isinstance(ax, SubplotBase):

0 commit comments

Comments
 (0)
0