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

Skip to content

Commit c151e71

Browse files
jklymaktimhoffm
andauthored
Fix list creation
Co-authored-by: Tim Hoffmann <[email protected]>
1 parent c20ce53 commit c151e71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/colorbar.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,8 +1414,8 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
14141414
# use .flatten or .ravel as these copy the references rather than
14151415
# reuse them, leading to a memory leak
14161416
if isinstance(parents, np.ndarray):
1417-
parents = [parent for parent in parents.flat]
1418-
if not isinstance(parents, list):
1417+
parents = list(parents.flat)
1418+
elif not isinstance(parents, list):
14191419
parents = [parents]
14201420
fig = parents[0].get_figure()
14211421

0 commit comments

Comments
 (0)