1 parent 3f3065d commit 3d64d65Copy full SHA for 3d64d65
1 file changed
lib/matplotlib/colorbar.py
@@ -1124,6 +1124,7 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
1124
anchor = kw.pop('anchor', loc_settings['anchor'])
1125
parent_anchor = kw.pop('panchor', loc_settings['panchor'])
1126
1127
+ parents_iterable = cbook.iterable(parents)
1128
# turn parents into a list if it is not already. We do this w/ np
1129
# because `plt.subplots` can return an ndarray and is natural to
1130
# pass to `colorbar`.
@@ -1191,7 +1192,7 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
1191
1192
# and we need to set the aspect ratio by hand...
1193
cax.set_aspect(aspect, anchor=anchor, adjustable='box')
1194
else:
- if len(parents) == 1:
1195
+ if not parents_iterable:
1196
# this is a single axis...
1197
ax = parents[0]
1198
lb, lbpos = constrained_layout.layoutcolorbarsingle(
0 commit comments