Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b76aeaa

Browse filesBrowse files
committed
FIX: colorbar check for constrained layout
1 parent 72770e6 commit b76aeaa
Copy full SHA for b76aeaa

File tree

Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-2
lines changed

‎lib/matplotlib/colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/colorbar.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,8 +1132,12 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
11321132
parents = np.atleast_1d(parents).ravel()
11331133

11341134
# check if using constrained_layout:
1135-
gs = parents[0].get_subplotspec().get_gridspec()
1136-
using_constrained_layout = (gs._layoutbox is not None)
1135+
try:
1136+
gs = parents[0].get_subplotspec().get_gridspec()
1137+
using_constrained_layout = (gs._layoutbox is not None)
1138+
except AttributeError:
1139+
using_constrained_layout = False
1140+
11371141
# defaults are not appropriate for constrained_layout:
11381142
pad0 = loc_settings['pad']
11391143
if using_constrained_layout:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.