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

Skip to content

Commit bb510b9

Browse files
tacaswellrcomer
andauthored
MNT: refactor to remove a level of indentation
Co-authored-by: Ruth Comer <[email protected]>
1 parent 9c36d85 commit bb510b9

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/matplotlib/colorbar.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,11 +1418,10 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
14181418
# turn parents into a list if it is not already. Note we cannot
14191419
# use .flatten or .ravel as these copy the references rather than
14201420
# reuse them, leading to a memory leak
1421-
if np.iterable(parents):
1422-
if isinstance(parents, np.ndarray):
1423-
parents = list(parents.flat)
1424-
else:
1425-
parents = list(parents)
1421+
if isinstance(parents, np.ndarray):
1422+
parents = list(parents.flat)
1423+
elif np.iterable(parents):
1424+
parents = list(parents)
14261425
else:
14271426
parents = [parents]
14281427

0 commit comments

Comments
 (0)