Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 764fbe5

Browse files
committed
FIX: subplots don't mutate kwargs passed by user.
1 parent 3d19f94 commit 764fbe5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/matplotlib/figure.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,9 @@ def subplots(self, nrows=1, ncols=1, sharex=False, sharey=False,
14711471
subplot_kw = {}
14721472
if gridspec_kw is None:
14731473
gridspec_kw = {}
1474+
# don't mutate kwargs passed by user...
1475+
subplot_kw = subplot_kw.copy()
1476+
gridspec_kw = gridspec_kw.copy()
14741477

14751478
if self.get_constrained_layout():
14761479
gs = GridSpec(nrows, ncols, figure=self, **gridspec_kw)

0 commit comments

Comments
 (0)