diff --git a/lib/matplotlib/colorbar.py b/lib/matplotlib/colorbar.py index a080eb59247c..5894ecf123c2 100644 --- a/lib/matplotlib/colorbar.py +++ b/lib/matplotlib/colorbar.py @@ -1117,9 +1117,10 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15, parent_anchor = kw.pop('panchor', loc_settings['panchor']) pad = kw.pop('pad', loc_settings['pad']) - # turn parents into a list if it is not already - if not isinstance(parents, (list, tuple)): - parents = [parents] + # turn parents into a list if it is not already. We do this w/ np + # because `plt.subplots` can return an ndarray and is natural to + # pass to `colorbar`. + parents = np.atleast_1d(parents).ravel() fig = parents[0].get_figure() if not all(fig is ax.get_figure() for ax in parents):