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 d530e47

Browse filesBrowse files
committed
Only consider visible Axises in Axes tightbbox.
1 parent 0fe574e commit d530e47
Copy full SHA for d530e47

File tree

Expand file treeCollapse file tree

1 file changed

+18
-16
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-16
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+18-16Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4143,22 +4143,24 @@ def get_tightbbox(self, renderer, call_axes_locator=True,
41434143
self.apply_aspect()
41444144

41454145
if self.axison:
4146-
try:
4147-
bb_xaxis = self.xaxis.get_tightbbox(
4148-
renderer, for_layout_only=for_layout_only)
4149-
except TypeError:
4150-
# in case downstream library has redefined axis:
4151-
bb_xaxis = self.xaxis.get_tightbbox(renderer)
4152-
if bb_xaxis:
4153-
bb.append(bb_xaxis)
4154-
try:
4155-
bb_yaxis = self.yaxis.get_tightbbox(
4156-
renderer, for_layout_only=for_layout_only)
4157-
except TypeError:
4158-
# in case downstream library has redefined axis:
4159-
bb_yaxis = self.yaxis.get_tightbbox(renderer)
4160-
if bb_yaxis:
4161-
bb.append(bb_yaxis)
4146+
if self.xaxis.get_visible():
4147+
try:
4148+
bb_xaxis = self.xaxis.get_tightbbox(
4149+
renderer, for_layout_only=for_layout_only)
4150+
except TypeError:
4151+
# in case downstream library has redefined axis:
4152+
bb_xaxis = self.xaxis.get_tightbbox(renderer)
4153+
if bb_xaxis:
4154+
bb.append(bb_xaxis)
4155+
if self.yaxis.get_visible():
4156+
try:
4157+
bb_yaxis = self.yaxis.get_tightbbox(
4158+
renderer, for_layout_only=for_layout_only)
4159+
except TypeError:
4160+
# in case downstream library has redefined axis:
4161+
bb_yaxis = self.yaxis.get_tightbbox(renderer)
4162+
if bb_yaxis:
4163+
bb.append(bb_yaxis)
41624164
self._update_title_position(renderer)
41634165
axbbox = self.get_window_extent(renderer)
41644166
bb.append(axbbox)

0 commit comments

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