Skip to content

Commit acbd1c3

Browse files
committed
Error check
1 parent bb6743c commit acbd1c3

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4150,12 +4150,20 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
41504150

41514151
if self.axison:
41524152
igl = 'x' if for_layout_only else None
4153-
bb_xaxis = self.xaxis.get_tightbbox(renderer, ignore_label=igl)
4153+
try:
4154+
bb_xaxis = self.xaxis.get_tightbbox(renderer, ignore_label=igl)
4155+
except TypeError as e:
4156+
# in case downstream library has redefined axis:
4157+
bb_xaxis = self.xaxis.get_tightbbox(renderer)
41544158
if bb_xaxis:
41554159
bb.append(bb_xaxis)
41564160

41574161
igl = 'y' if for_layout_only else None
4158-
bb_yaxis = self.yaxis.get_tightbbox(renderer, ignore_label=igl)
4162+
try:
4163+
bb_yaxis = self.yaxis.get_tightbbox(renderer, ignore_label=igl)
4164+
except TypeError as e:
4165+
# in case downstream library has redefined axis:
4166+
bb_xaxis = self.yaxis.get_tightbbox(renderer)
41594167
if bb_yaxis:
41604168
bb.append(bb_yaxis)
41614169
self._update_title_position(renderer)

0 commit comments

Comments
 (0)